-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[multiple-use issue!] Move a translation text into a centralized file #3515
Comments
Can i took this issue @jywarren ?? |
Please give it a try! I'd love to know if the issue makes sense or I missed
something. Note that multiple people may complete this one! Tell me how it
goes!
…On Fri, Sep 28, 2018, 10:21 AM Sunil K. Jain ***@***.***> wrote:
Can i took this issue @jywarren <https://github.com/jywarren> ??
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3515 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ4cKG7gczy4N3WOujeJeelVcMuDlks5ufkxbgaJpZM4W9C2F>
.
|
This task is published on GCI dashboard. Thanks all. |
May I have this task please and thanks? I'm here from GCI. |
Yeah go ahead |
Hi may I have this task? I'm also from GCI |
Yeah sure. Go ahead
…On Mon, Nov 5, 2018, 6:34 PM Samyu Ravikumar ***@***.***> wrote:
Hi may I have this task? I'm also from GCI
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#3515 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AUACQ_C2Uzy6c6YKUiD3GHTxh9-kJH4wks5usDdDgaJpZM4W9C2F>
.
|
Closing this as we have achieved this a little back and the centralized file is at https://github.com/publiclab/plots2/blob/master/config/locales/en.yml Thanks all! |
This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!
We're starting a big project to (#3262) revamp and refresh our internationalization systems, and one basic task we'd LOVE help with is to start moving translations around the site into a more centralized location t help make them easier to manage.
It's pretty easy! Try this:
Find a single translation
First, look through files in this set of folders: https://github.com/publiclab/plots2/blob/master/config/locales/
Dig into the subfolders and find an
en.yml
- full of English textWe want to move all the lines in these files into the main
en.yml
file at the root of these folders; this file:https://github.com/publiclab/plots2/blob/master/config/locales/en.yml
So take one translation, like this line:
plots2/config/locales/controllers/application_controller/en.yml
Line 3 in 35449fd
How do we move it?
Move the single line of text
Cut it from the original file and paste it into the top of the base file just below
en:
-- so between lines 3 and 4 in this example:plots2/config/locales/en.yml
Lines 2 to 5 in 35449fd
Keep the indentation the same! 👀
See how it was indented under
application_controller:
? Copy that line in too, above your first one, but don't delete it from the original file.plots2/config/locales/controllers/application_controller/en.yml
Lines 1 to 4 in 35449fd
In this case, you should end up with your root
en.yml
looking like:Be sure to get all the "nested" lines
Many translations are nested a few levels deep, which means we have to copy each "level". Take this for example:
plots2/config/locales/views/dashboard/_activity/en.yml
Lines 3 to 7 in 5c0d962
In this case, we want to copy those over when we move the translation, so it's still accessible by the string (in this example)
t('dashboard._activity.share_work')
. See this for an example of how these translations are used in code:plots2/app/views/dashboard/_activity.html.erb
Line 1 in 5c0d962
Don't worry, if you get this step wrong we can help you troubleshoot once you open a pull request! 🙌
See an example
The changes we've done in this guide have been compiled into a pull request so you can see them all together. Read through this for guidance!
https://github.com/publiclab/plots2/pull/3514/files
Good luck, and we're here to help! 👍
Many thanks! ⚡️ ⚡️
The text was updated successfully, but these errors were encountered: