-
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
Adding new strings for Translation #9945
Labels
Translation System
issues which involve adding new translations, improving the translation system
Comments
imajit
added
the
Translation System
issues which involve adding new translations, improving the translation system
label
Jul 24, 2021
I can create a fto for this |
@unnati914 that would be super! Perhaps check with @imajit once you've created it to give it a quick look over, then we can label it? Thank you! |
surely |
This was referenced Aug 21, 2021
This was referenced Sep 8, 2021
5 tasks
if this issue is open can I please work @TildaDares can u please assign me |
Hey @TildaDares please can i work on this? |
can i create a FTO on this? |
@TildaDares ok thanks |
@TildaDares Can I create FTO on this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Translation System
issues which involve adding new translations, improving the translation system
Goal of this issue is to create FTOs for Public Lab Translation Project
Part of #9686
There are many strings that are kind of hard-coded in many views files .
For example
plots2/app/views/layouts/_header.html.erb
Line 12 in b73594f
here you can see
Public Lab
is added as a string.Ideally, we would like to have a string constant in
en.yml
saved aspubliclab = "Public Lab"
and then refer to this in all the occurrences of the string "Public Lab". There are 2 benefits of thisWe have many strings that need to be added to the Transifex project for translation. We can do this by adding new FTOs.
Here I have tried to break all possible FTOs into 3 types
1. Adding a new string to Translation Project
For this type of FTOs, we need to add the missing string to the YAML file and then call the translation function where the sting was present.
Steps to create an FTO of this type
Let's say I want to add "Public Lab" string to the YAML file.
publiclab: "Public Lab"
translation('home.publiclab')
Here is a sample FTO of this type Add "Features" string to Translation Project #9950
Note:
hello
which is in a view related to the tags controller, then I can add it under tag controller string set.plots2/config/locales/en.yml
Line 1030 in b73594f
plots2/config/locales/en.yml
Line 893 in b73594f
the string you can call it using
translation('talk.show.welcome')
2. Replacing a string with a translation function
Let's say the string "Public Lab" is stored as a string in the YAML file, but there are multiple occurrences where the string is added directly as part of the view, we can change this by calling the translation function in place of the string.
Steps to create an FTO of this type
Here is a sample FTO of this type Change "Dashboard" String to Translation Function Call #9944
3. Adding strings that are part of HTML attributes
This type of FTOs can be a bit tricky and UI checks are preferred before merging PRs.
Consider this line of code
plots2/app/views/layouts/_header.html.erb
Line 20 in b73594f
The translation function is called inside an HTML tag here for an HTML attribute
placeholder
, the difference here is that the additional parameterfalse
is also passed here.Steps to create an FTO of this type
Here is a sample FTO of this type Fix profile tag input bar #9934
Feel free to reach out if you have any doubts regarding the creation or reviewing of FTOs
The text was updated successfully, but these errors were encountered: