Simplify localization via config.ts #37

Closed
opened 2023-06-20 18:18:28 +02:00 by migration-script · 0 comments

Story

As a developer, I do not want to manually maintain a list of keys from the config.ts for dictionaries that should be localized.

Description

The config.ts holds -- amongst others -- mappings from code-internal keys to translation keys, which are needed for proper localization in loops in the HBS templates.
For performance reasons (I think), the translation keys are currently in-place replaced by their actual translation strings during init in the ds4.ts. However, the members of the config.ts CONFIG object that are such a key-to-translation-key mapping must for now be manually recorded in the ds4.ts for this to work.
This is slightly inconvenient for maintenance, and it is not clear whether the in-place override of values can cause issues sometimes (e.g. when changing language).
Thus, it would be good to avoid the manual recording and the in-place override.

This should best be done before #54.

Acceptance criteria

  • No manual recording of the translation mappings from the CONFIG object necessary in the ds4.ts. Instead, placing new mappings correctly in the CONFIG object does the trick.
  • No values in the CONFIG object are overridden.
  • Any changes to the API of the translation mappings in the config are adapted in all templates.
# Story As a developer, I do not want to manually maintain a list of keys from the config.ts for dictionaries that should be localized. # Description The `config.ts` holds -- amongst others -- mappings from code-internal keys to translation keys, which are needed for proper localization in loops in the HBS templates. For performance reasons (I think), the translation keys are currently *in-place* replaced by their actual translation strings during init in the `ds4.ts`. However, the members of the `config.ts` `CONFIG` object that are such a key-to-translation-key mapping must for now be manually recorded in the `ds4.ts` for this to work. This is slightly inconvenient for maintenance, and it is not clear whether the in-place override of values can cause issues sometimes (e.g. when changing language). Thus, it would be good to avoid the manual recording and the in-place override. This should best be done before #54. # Acceptance criteria - [ ] No manual recording of the translation mappings from the `CONFIG` object necessary in the `ds4.ts`. Instead, placing new mappings correctly in the `CONFIG` object does the trick. - [ ] No values in the `CONFIG` object are overridden. - [ ] Any changes to the API of the translation mappings in the config are adapted in all templates.
gesina was assigned by migration-script 2023-06-20 18:18:28 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: dungeonslayers/ds4#37
No description provided.