-
Notifications
You must be signed in to change notification settings - Fork 64
Migrate hardcoded strings to i18n vars #523
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
Migrate hardcoded strings to i18n vars #523
Conversation
@swift-ci test |
bd1c194
to
53c6389
Compare
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.
Good job, here are some thoughts:
- Stitching sentences in general is a bad idea. Left commends on a few of the places, but I think we should rethink those a bit.
- async load translations as future improvement would be nice
- use user browser locale as a future improvement as well
- How would this tie to the router?
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
*/ | ||
|
||
import VueI18n from 'vue-i18n'; |
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.
Maybe move this to the /plugins
dir?
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.
Well, I implemented it in the same way as SwiftDocCRenderRouter
is. What part of the code would you move to the plugins folder?
53c6389
to
1e90571
Compare
Thanks for review it @dobromir-hristov !
I agree. I fixed them.
That would be nice. I haven't implemented it yet because we have very few languages but I'll do it in the future.
Yes. We will be working on it in a different PR. It's out of scope for this one.
This is also out of scope for this PR but working on it. |
ff0b80f
to
b0c80c1
Compare
@swift-ci test |
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.
Looking great!! Just left a few minor questions/comments. Do we also need to update the headers to these files? 😅
src/components/DocumentationTopic/DocumentationNav/LanguageToggle.vue
Outdated
Show resolved
Hide resolved
src/components/DocumentationTopic/PrimaryContent/PossiblyChangedMimetype.vue
Outdated
Show resolved
Hide resolved
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.
So many changes! 😅 Nice work 🙌
I haven't had time to actually test this very closely yet, but I did a full pass on reviewing all the code (except for the tests).
One general comment I have is that it would be nice if we could come up with a more consistent way of naming the message keys. Maybe we could use the component name as prefixes or something where it's a little more obvious to mentally map the strings to how they're used. You've probably thought a lot about this already and have opinions on the naming scheme I'm guessing.
src/components/DocumentationTopic/PrimaryContent/ParameterAttributes.vue
Outdated
Show resolved
Hide resolved
Thanks for the great feedback, @hqhhuang and @mportiz08 !!
Oh no, I still need to update the headers 🫣
I'm open to suggestions! Naming is always the most difficult part. Any ideas? |
@swift-ci test |
77c4b7f
to
d444249
Compare
@swift-ci test |
a653841
to
d0f911a
Compare
Signed-off-by: Marina Aísa <[email protected]>
Resolves: rdar://100278813
Signed-off-by: Marina Aísa <[email protected]>
d0f911a
to
8d88e4c
Compare
@marinaaisa can you sync this with the latest main and resolve the conflicts? Hopefully they're minor and easy to fix. I think we're ready to merge this tomorrow once that's done. |
Done! ✅ |
@swift-ci test |
…-i18n' into r104876012/routering-metadata-i18n
Add routering and metadata logic to i18n project
@swift-ci test |
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.
Looks good, but I ran into some integration issues that we'll need to figure out next week before we can merge this. I'll reach out offline.
Bug/issue #102139999, if applicable:
Summary
This PR migrates hardcoded strings into i18n vars, including translation files for Chinese and Japanese.
Dependencies
vue-i18n
Testing
Steps:
theme-settings.json
file at public foldernpm run serve
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded