Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Languages support #36

Closed
2 of 5 tasks
wojciechczerniak opened this issue Nov 19, 2019 · 4 comments
Closed
2 of 5 tasks

Languages support #36

wojciechczerniak opened this issue Nov 19, 2019 · 4 comments
Labels
API Public methods and properties Feature Something we can add later on without introducing a breaking change
Milestone

Comments

@wojciechczerniak
Copy link
Contributor

wojciechczerniak commented Nov 19, 2019

Description

The only small change proposed here is to add language name and language code.

  • Add language code
  • If the specified language is not found, fallback to default, English.
  • If a function is not translated it cannot be used. Return error as for unknown formula.
  • Add test for language files that compare language.functions keys with registeredPlugins keys
  • Language should be set as language code in Config Global settings #58
    language: enGB,

Language definition

const lang: LanguageDefinition = {
  languageCode: 'pl-PL',
  errors: {
    DIV_BY_ZERO: '#DZIEL/0!',
    NAME: '#NAZWA?',
    VALUE: '#ARG!',
    NUM: '#LICZBA!',
    NA: '#N/A',
    CYCLE: '#CYKL!',
    REF: '#ADR!',
  },
  interface: {
    NEW_SHEET_PREFIX: 'Arkusz'
  },
  functions: {
    'SUM': 'SUMA',
    'ADD': 'DODAJ',
    // ... more functions
  },
}

API proposal

public static registerLanguage(lang: LanguageDefinition): void;
public static getLanguage(name: string): LanguageDefinition;
public static getLanguages(): string[]; // ['pl-PL', 'en-GB', ...]
This was referenced Nov 19, 2019
Closed
@wojciechczerniak wojciechczerniak changed the title Language and culture support Languages support Nov 26, 2019
@wojciechczerniak wojciechczerniak added this to the Februrary 2020 milestone Dec 10, 2019
@wojciechczerniak wojciechczerniak added API Public methods and properties Feature Something we can add later on without introducing a breaking change labels Dec 10, 2019
This was referenced Feb 26, 2020
@wojciechczerniak wojciechczerniak mentioned this issue Mar 2, 2020
7 tasks
@izulin
Copy link
Collaborator

izulin commented Mar 3, 2020

To be remembered -- after language rework, we should add a sanity check in config initialization (see #146 )

@izulin
Copy link
Collaborator

izulin commented Mar 19, 2020

from #260 : "we could introduce a method getTranslation('interface.NEW_SHEET_PREFIX') to be sure the getter is unit tested correctly and we have fallbacks in place.

Right now I see here possible three null exceptions"

@izulin izulin mentioned this issue Mar 20, 2020
7 tasks
@wojciechczerniak
Copy link
Contributor Author

wojciechczerniak commented Apr 5, 2020

Unfortunately, this is not done yet. Please, see the review: #263 (review) for details

@izulin izulin mentioned this issue Apr 6, 2020
7 tasks
@wojciechczerniak
Copy link
Contributor Author

Done in #263 and #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Public methods and properties Feature Something we can add later on without introducing a breaking change
Projects
None yet
Development

No branches or pull requests

3 participants