Skip to content
This repository has been archived by the owner. It is now read-only.

[i18n] Clean up translation strings #153

Closed
ktmud opened this issue Feb 12, 2021 · 2 comments
Closed

[i18n] Clean up translation strings #153

ktmud opened this issue Feb 12, 2021 · 2 comments
Labels
i18n Localization and internationalization

Comments

@ktmud
Copy link

ktmud commented Feb 12, 2021

Motivation / Problem to Solve

To have more accurate translations, translation keys need be unique to its context and should not be reused in different context. For example, in Chinese, you don't just say "Next" (下一个)in most context,but always be specific of next of what (e.g. ”Next page" (下一页),Next picture (下一张)).

It's even more problematic to concat translated strings, e.g.:

_("You don't have the rights to ")  + _("alter this ") + _("dashboard"),

This may save some translation strings but will make it more difficult to translate when a language has a different word order than English.

Proposed Functionality

  • Step 1: Clean up all concatenated translation strings
  • Step 1.5 (Optional): Update i18n solution, make it possible to fallback to English translated strings.
  • Step 2: Replace all translation keys with unique, contextualized keys. E.g.
     _('global.menu.Charts')
    
@junlincc
Copy link
Collaborator

junlincc commented Feb 13, 2021

+1, long haul though

@ktmud
Copy link
Author

ktmud commented Feb 13, 2021

Step 1 should be pretty easy.

@ktmud ktmud added the i18n Localization and internationalization label Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i18n Localization and internationalization
Projects
None yet
Development

No branches or pull requests

2 participants