techniq / techniq/layerchart

Intl support

Open
#583 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
41
Avg merge
2d 19h
Merged PRs (30d)
16

Description

Under the hood, LayerChart uses LayerStack's format util to format dates and numbers.

We have plans to add a settings() context similar to Svelte UX to control this globally (as well as setting default props and global styling refinements).

Until settings is added, you can override the defaultLocale exported from @layerstack/utils

import { createLocaleSettings, defaultLocale } from '@layerstack/utils';

export function localizeLayerChart() {
    Object.assign(
        defaultLocale,
        createLocaleSettings({
            locale: 'es',
            formats: { ... }
        })
    )
}

You can also format on a per-chart / component basis:

<script>
  import { format } from '@layerstack/utils';
</script>

<Axis format={x => format(x, { locale: 'es' })} />

Discussion

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the LayerStack format utility documentation and the exported defaultLocale/createLocaleSettings entry points shown in the issue. Read the linked settings issue and Svelte UX settings reference to define how global locale and format settings should be exposed. Done means LayerChart supports the planned global internationalization settings without requiring per-chart overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.