Skip to content

Commit

Permalink
Updating Translation_System.md (#11121)
Browse files Browse the repository at this point in the history
previous commit did not include line 44
  • Loading branch information
ronran1 authored May 7, 2022
1 parent 4089a4a commit 9c906c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/Translation_System.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ There are breaks in the UI sometimes (especially if translations are used within

## Calling translation function

The function works on the `i18n` gem [here](https://guides.rubyonrails.org/i18n.html) and [yaml file structure](https://github.com/publiclab/plots2/tree/main/config/locales). Each yaml file in mapped with corresponding translation resource on [Transifex project](https://www.transifex.com/publiclab/publiclaborg/dashboard/). This function from any `.html.erb` view files.
The function works on the `i18n` gem [here](https://guides.rubyonrails.org/i18n.html) and [yaml file structure](https://github.com/publiclab/plots2/tree/main/config/locales). Each yaml file is mapped with corresponding translation resource on the [Transifex project](https://www.transifex.com/publiclab/publiclaborg/dashboard/). This function may be called from any of the `.html.erb` view files.


Here is how the call looks

Expand All @@ -41,7 +42,8 @@ Here is how the call looks
See an [example here](https://github.com/publiclab/plots2/blob/e646cfd248e46fe9cf11a2eb7860bbf29f949b7d/app/views/dashboard/_header.html.erb#L6).
There is one prerequisite to call translation function for a string, it should be present in the [`en.yml` file](https://github.com/publiclab/plots2/tree/main/config/locales/en.yml) else function won't correctly. In most of the cases, function call only requires the YAML keys. You can read more about YAML keys [here](https://yaml.org/spec/1.2/spec.html), I feel various calls that exist in the views files code are kind of self-explanatory.
There is one prerequisite to call translation function for a string, it should be present in the [`en.yml` file](https://github.com/publiclab/plots2/tree/main/config/locales/en.yml) else it won't work correctly. In most of the cases, function call only requires the YAML keys. You can read more about YAML keys [here](https://yaml.org/spec/1.2/spec.html). I feel various calls that exist in the views files code are kind of self-explanatory.
### Additional html parameter
Expand Down

0 comments on commit 9c906c0

Please sign in to comment.