Replies: 3 comments 3 replies
-
I will look into this more soon and hopefully resolve #9. |
Beta Was this translation helpful? Give feedback.
-
I can try to make a PR, but this idea changes too much, I don't know if it will break compatibility, because this logic is like this: all core source code uses strings to call the functions in the i18n package, and then we use the AST package of the go standard library to parse all the calls in the syntax tree containing the methods in the i18n package before any app initialization and save them to a map, the key value pair of the map is a translated copy of multiple Chinese, when we complete the translation, Before the main function is called, load our translated map file into memory, at this time, all GO code calls i18n will query the map key-value pair in the language file we specified in the main function, and each call will return the MAP key:English corresponding value: the text we translated. https://github.com/richardwilkes/gcs/blob/master/ux/about.go#L57-L58 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
use this for support i18n
https://github.com/richardwilkes/toolbox/blob/master/i18n/i18n/main.go
Beta Was this translation helpful? Give feedback.
All reactions