-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SRO] Organize DM-l10n strings #2491
base: master
Are you sure you want to change the base?
Conversation
- rename sheet to common - expand sheet strs to cover generalized, common "game" terms - remove `{SPACE}` when processing certain DM strings in certain languages
Experiment for extracting common non-game-specific UI strings. Would need a new pipeline if we wanted to commit to this idea.
[sr-frontend] [Thu Oct 10 21:46:15 UTC 2024] - Deployed 328093d to https://genshin-optimizer-prs.github.io/pr/2491/sr-frontend (Takes 3-5 minutes after this completes to be available) [sr-frontend] [Fri Oct 18 00:03:21 UTC 2024] - Deployed 07209d5 to https://genshin-optimizer-prs.github.io/pr/2491/sr-frontend (Takes 3-5 minutes after this completes to be available) |
libs/sr/dm-localization/src/executors/gen-locale/lib/commonHashData.ts
Outdated
Show resolved
Hide resolved
|
||
// Remove '{SPACE}' artifacts from certain strings | ||
// Do this first to match curly brackets to prevent interfering with later str replacements | ||
str = str.replace(/(.*?){SPACE}/g, '$1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certain strings will contain {SPACE}
at the end, so this is just an exact match to strip it out. This shouldn't conflict with any of the other matching/processing we're doing.
libs/sr/dm-localization/src/executors/gen-locale/lib/commonHashData.ts
Outdated
Show resolved
Hide resolved
@@ -36,40 +37,6 @@ export const HashData = { | |||
lightCone: lightConeHashData, | |||
lightConeNames, | |||
|
|||
sheet: sheetHashData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the reason why we have separated namespace -> separated .JSON is that translations are usually lazy loaded. when the artifact page is loaded, it doesn't need any of the character/team UI translations, and vice versa. This can impact load time of pages and elements, since most of our elements are behind loading barriers and suspenses. we can designate some of the namespace to be permanently loaded(i think "ui" is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's understandable, and in this commit I split up a lot more of the namespaces in light of this information. Though, it also means I'm not quite sure where to put some of these smaller namespaces (e.g. common, team, paths, statKey) or what the file should be (miscHashData
perhaps?).
Also, can you bundling in l10n for these strings #2440 (comment), I believe they can be partially retrieved from dm. |
@@ -128,4 +128,4 @@ const charArray = Object.entries(avatarConfig).map(([charId, charConfig]) => { | |||
|
|||
const data = Object.fromEntries(charArray) | |||
verifyObjKeys(data, allCharacterDataKeys) | |||
export const charHashData = data | |||
export const allCharHashData = data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are better name/organization suggestions from what I've done in this commit (move all related files into related folders and rename the original files generating all chars/LCs/relics + their data into terms that possibly better indicate that they're for 'generating all assets for a category'), please let me know.
looks mostly organized for me. for the singular/plural, I think i prefer in the way indicated by the i18next format:
rather than the |
Describe your changes
sheetHashData
tocommonHashData
with generalized, game-related strings{SPACE}
artifact during DM string preprocessing for certain languagesNotes:
Unlock All Artifacts
vs simply usingUnlock All
and implying 'All Artifacts' context from being on the Artifacts page), so if we wanted to use these strings, we'd either commit to more generalized/"vague" wording or combine translated words (sounds messy).TODO:
Issue or discord link
Resolves #2475.
Testing/validation
Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)
yarn run mini-ci
locally to validate format and lint.