refactor(l10n): macro gen and verify all strings exist#179
refactor(l10n): macro gen and verify all strings exist#179Kyza wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
|
I didn't realize #85 existed. I can rebase this off of those changes once it gets merged. |
| pt_br: "Ctrl", | ||
| ru: "Ctrl", | ||
| zh_hans: "Ctrl", | ||
| zh_hant: "Ctrl", |
There was a problem hiding this comment.
Oooooh... That's neat. 😲 Way neater than what I had in mind!
I think may be beneficial to keep as much outside the macro as possible though. Isn't editing macros still a bit of a pain in most IDEs?
There was a problem hiding this comment.
It is pretty annoying. You end up losing suggestions. I just worked on moving some code outside of the macro.
|
Admittedly I'm not that great at Git. I tried rebasing on the latest commit from main, but I'm not entirely sure if I did it right. Edit: Definitely did not do that right. I ended up force pushing. lol |
| )+ | ||
| ] | ||
| } | ||
| pub const fn name(&self) -> &'static str { |
There was a problem hiding this comment.
This would be for using the name of the language as a string in the UI. For example if a language switcher is added.
|
I may need to come back to this PR later, as I want to focus on bug fixes first. There's quite a few of them: https://github.com/microsoft/edit/issues?q=is%3Aissue%20state%3Aopen%20label%3AI-bug |
|
Now that #591 we can close this PR. Thank you for your patience and I apologize that for the work you put into this. 🙈 |
Draft for #165 and (might) fix #74.
Implements basic macro generation for the localizations and verifies that all languages have all possible strings with a test.
It looks like the only way to generate a
#[cfg(feature = "name")]is through a proc macro which would require a separate crate. Considering Edit's probably very intentional lack of dependencies and current structure I decided to leave that out at least for now.I haven't formatted the macro yet because that work is better suited for when this is finished.
It might be worth adding a language switcher to the menubar as well if data storage is viable.