♻️ Refactor i18n: use short keys in t9n() function#373
Merged
Conversation
44e3ad0 to
d267e35
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Renamed translation function from
t()tot9n()for clarityRestructured
en.tslocale file with hierarchical short keys instead of full strings:heading.*export-*,import.*,use-snippet.*drop-shadow.*,collapsible.*,collapse-type.*, etc.btn.save,btn.edit,btn.delete, etc.error.type-empty,error.icon-invalid, etc.modal.title.*,modal.collapsible.*admonition-type.name,admonition-title.*, etc.Updated
zh-cn.tslocale with partial translations using new key structureUpdated all imports and function calls throughout codebase to use
t9n()instead oft()Improved maintainability by centralizing all English strings in
en.tsFiles Modified
src/lang/helpers.ts- Function renamesrc/lang/locale/en.ts- Complete restructure with hierarchical keyssrc/lang/locale/zh-cn.ts- Updated keys (partial translation)src/settings.ts,src/modal/*.ts,src/util/validator.ts- Updated allt()calls tot9n()