Skip to content

Commit 4b6af7d

Browse files
authored
Merge branch 'main' into unlock-note
2 parents d905644 + 60c379e commit 4b6af7d

File tree

2 files changed

+103
-61
lines changed

2 files changed

+103
-61
lines changed

web/Weblate-server.qmd

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ docker-compose -f docker-compose-https.yml -f docker-compose-https.override.yml
117117
docker-compose -f docker-compose-https.yml -f docker-compose-https.override.yml up
118118
```
119119

120-
To update, follow the
120+
To update, follow the
121121
[official docs](https://docs.weblate.org/en/latest/admin/install/docker.html#upgrading-the-docker-container), but in
122122
short:
123123

@@ -145,15 +145,16 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
145145
1. Get the two repos cloned on any machine. If this is your first time generating a patch on this machine:
146146

147147
```sh
148-
git clone -o weblate https://translate.rx.studio/git/r-project/base-r-gui/ # remote #1: Weblate source
149-
git remote add svn git remote add svn [email protected]:r-devel/r-svn.git # remote #2: SVN source
150-
git fetch svn master # retrieve the latest from SVN
148+
mkdir weblate-diff && cd weblate-diff
149+
git clone -o weblate https://translate.rx.studio/git/r-project/base-r-gui/ . # remote #1: Weblate source
150+
git remote add svn [email protected]:r-devel/r-svn.git # remote #2: SVN source
151+
git fetch svn main # retrieve the latest from SVN
151152
```
152153

153154
If you've got the repo set up locally already, update:
154155

155156
```sh
156-
git fetch svn master
157+
git fetch svn main
157158
git fetch weblate master
158159
git reset --hard weblate/master # force-reset to match state on Weblate (usual caution with --hard applies)
159160
```
@@ -182,7 +183,7 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
182183
}
183184
184185
weblate_summary <- po_counts(po_files())
185-
set_branch('svn/master')
186+
set_branch('svn/main')
186187
svn_summary <- po_counts(po_files())
187188
set_branch('master')
188189
@@ -194,7 +195,7 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
194195
log_info('Dropping {.N} empty files:')
195196
.SD[, by = package, {
196197
log_level(INFO, 'From package {blue(.BY$package)}:')
197-
log_level(INFO, ' {toString(green(basename(filename)))}', .topenv = .SD) # NB: Need .SD since data.table doesn't pick up the variable from the string
198+
log_level(INFO, ' {toString(green(basename(filename)))}', .topenv = list2env(.SD)) # NB: Need .SD since data.table doesn't pick up the variable from the string
198199
}]
199200
unlink(filename)
200201
NULL
@@ -208,7 +209,7 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
208209
log_info('New translations in {.N} files')
209210
.SD[, by = package, {
210211
log_level(INFO, 'From package {blue(.BY$package)}:')
211-
log_level(INFO, ' {sprintf("%s [+%s]", green(format(basename(filename))), red(format(n_newly_translated)))}', .topenv = .SD)
212+
log_level(INFO, ' {sprintf("%s [+%s]", green(format(basename(filename))), red(format(n_newly_translated)))}', .topenv = list2env(.SD))
212213
}]
213214
NULL
214215
}]
@@ -236,20 +237,24 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
236237
1. Generate a patch file from the diff, going back to the most recent commit with translations merged, e.g.
237238

238239
```sh
239-
# NB: _not_ 'git diff weblate/master svn/master' since we've just deleted the empty .po files locally
240-
git diff svn/master --no-prefix -- "*.po"
240+
# NB: _not_ 'git diff weblate/master svn/main' since we've just deleted the empty .po files locally
241+
git diff svn/main --no-prefix -- "*.po"
241242
```
242243

243244
1. Share the patch file on the R Contributors Slack group's #core-translation channel and kindly ping @MichaelLawrence for his assistance on getting the patch file applied on the trunk of R dev to get it merged. We should do this ~once per quarter.
244245

245246
## Maintenance
246247

248+
### Unlock components
249+
247250
Components might become locked due to "not being able to push back to the upstream repo" (expected) or when upstream is not updated for a long time. In such case, components can be unlocked on the UI, but this needs to happen at the component level, so better to use the CLI instead:
248251

249252
```sh
250253
weblate unlock_translation r-project
251254
```
252255

256+
### Git rebase conflicts
257+
253258
When there's a conflict between SVN and the Weblate git repo, and Weblate cannot pull from the upstream repo, you will need to resolve the conflicts manually after seeing an error like the below:
254259

255260
```sh
@@ -309,13 +314,25 @@ Weblate will provide a suggestion on how to fix, but in short:
309314
./deconflict_add_continue.py weblate
310315
```
311316

312-
This finds the **one** file causing conflicts, selects the changes from Weblate (in order to preserve string edit history in the UI), removes the changes from SVN and the git conflict markers, then continues the rebase process. It also prints some helpful output, e.g. the number of conflicts resolved and the `git status` which tells about progress in the ongoing rebase.
317+
Note that at the start of the rebase process, the script will not be available in the repo (as was added there later in the git history), but you can download it from the above URL or copy the backup from the root user's home directory.
318+
319+
This script originally found the one file causing conflicts, selected the changes from Weblate (in order to preserve string edit history in the UI), removed the changes from SVN and the git conflict markers, then continued the rebase process. At the time being, it should be able to handle multiple files as well (iterating over all conflicting files), but manual intervention might be needed from time to time. It also prints some helpful output, e.g. the number of conflicts resolved and the `git status` which tells about progress in the ongoing rebase.
313320

314-
For now, if there are more than one files affected by a given rebase step (e.g. more than one file marked `both modified:` in the `git status` output), these needed to be edited manually (with the text editor of your choice, e.g. `nano` or `mcedit`), then added (`git add`) before continuing (`git rebase --continue`). This should be rare as Weblate typically associates one file edit per commit. The `deconflict_add_continue.py` step could be extended to handle several files, but we've not yet done so. Note also the script [`show_conflicts.py`](https://github.com/daroczig/R-weblate-fork/blob/main/show_conflicts.py) which takes a file name as an argument and prints a side-by-side view of any git conflicts in the file.
321+
When the script resolved the conflicts, you might need to confirm the commit message (e.g. hit `F2` in the opened nano editor), then run the script again and again and again until the rebase completes.
322+
323+
If needed, edit file(s) manually (with the text editor of your choice, e.g. `nano` or `mcedit`), then add (`git add`) before continuing (`git rebase --continue`). This should be rare as Weblate typically associates one or a few file edits per commit. Note also the script [`show_conflicts.py`](https://github.com/daroczig/R-weblate-fork/blob/main/show_conflicts.py) which takes a file name as an argument and prints a side-by-side view of any git conflicts in the file.
315324

316325
1. Restore changes that may have been lost from SVN, e.g. newly updated source strings or source line numbers, by running `msgmerge` on all pot files using the script [`update_pkg_po.py`](https://github.com/daroczig/R-weblate-fork/blob/main/update_pkg_po.py).
317326

318-
1. All done 🎉🎉! Now you can unlock weblate: `weblate unlock_translation r-project`
327+
1. Don't forget to unlock the components after the rebase is complete: `weblate unlock_translation r-project`
328+
329+
### Bot attacks
330+
331+
Sometimes we experience massive traffic originating from bots at a single IP or subnet, which might bring down the service. To mitigate this, we can block the IP addresses on the server or at the related VPC's network ACL.
332+
333+
Currently, the following IP addresses are blocked:
334+
335+
- 47.79.0.0/16 (ACL)
319336

320337
## Administrators
321338

@@ -344,3 +361,19 @@ There are language teams defined in each project with the below extra permission
344361
- Manage translation memory
345362

346363
See the general [Weblate FAQ](Weblate-FAQ.qmd#how-to-manage-translation-teams-in-weblate) on how to manage members.
364+
365+
### Creating a new language team
366+
367+
Language team creation should be done in a transparent way to the community, so that all translators of the same language can be aware of the team creation and decide on the dedicated reviewers workflow.
368+
369+
Once the list of initial team leaders and administrators is defined, a Weblate admin should first create the team within the "R Project" Weblate project: <https://translate.rx.studio/access/r-project/#teams>
370+
371+
The list of roles to be added:
372+
373+
- Review strings
374+
- Manage translation memory
375+
- Manage glossary
376+
377+
Users need to be added by their Weblate user ID, which can be searched for at <https://translate.rx.studio/manage/users/> if unknown.
378+
379+
Note that there's a special checkbox for Team Administrators at the time of adding a user to the team, which should be checked for the initial team leaders so that they can manage the team members.

web/index.qmd

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,86 +6,95 @@ title: "Home"
66

77
Welcome to the translation adventure in R! 🚀
88

9-
In a world that thrives on interconnectedness and global communication, translation plays a pivotal role in bridging
10-
linguistic divides. Translation, the art of rendering one language into another, shatters those confines, unlocking a
9+
In a world that thrives on interconnectedness and global communication, translation plays a pivotal role in bridging
10+
linguistic divides. Translation, the art of rendering one language into another, shatters those confines, unlocking a
1111
world of possibilities for understanding and collaboration.
1212

1313
[Translation dashboards](https://contributor.r-project.org/translations-dashboard/)
1414

1515
So if you want to start, you can contribute by following these steps:
1616

17-
1. Sign up to the [R Contributors Slack](https://contributor.r-project.org/slack) and introduce yourself in the
17+
1. Sign up to the [R Contributors Slack](https://contributor.r-project.org/slack) and introduce yourself in the
1818
#core-translations channel;
1919

20-
1. Create an account on [Weblate](https://translate.rx.studio/) (currently maintained by
21-
[@daroczig](https://twitter.com/daroczig)) and read the Translations chapter on the [R Development
20+
1. Create an account on [Weblate](https://translate.rx.studio/) and read the Translations chapter on the [R Development
2221
guide](https://contributor.r-project.org/rdevguide/);
2322

24-
1. Read the [Conventions for translation](Conventions_for_Languages/index.qmd)
23+
1. Read the [Conventions for translation](Conventions_for_Languages/index.qmd)
2524
section of this Wiki, for some conventions that should be followed;
2625

27-
1. Read the guidelines for the specific language you want to contribute to. If a guideline for your language doesn't
26+
1. Read the guidelines for the specific language you want to contribute to. If a guideline for your language doesn't
2827
exist yet, please feel free to submit a pull request and create it.
2928

30-
|Language |
31-
| -- |
32-
|[Arabic](Conventions_for_Languages/Arabic-specific-translations.qmd) |
33-
|[Bengali](Conventions_for_Languages/Bengali-specific-translations.qmd)|
34-
|[Catalan](Conventions_for_Languages/Catalan-specific-translations.qmd)|
35-
|[Chinese](Conventions_for_Languages/Chinese-specific-translations.qmd)|
36-
|[Hindi](Conventions_for_Languages/Hindi-specific-translations.qmd)|
37-
|[Nepali](Conventions_for_Languages/Nepali-specific-translations.qmd)|
38-
|[Portuguese (Brazilian)](Conventions_for_Languages/Brazilian‐Portugese-specific-translations.qmd)|
39-
|[Spanish](Conventions_for_Languages/Spanish-specific-translations.qmd)|
29+
|Language |
30+
| -- |
31+
|[Arabic](Conventions_for_Languages/Arabic-specific-translations.qmd) |
32+
|[Bengali](Conventions_for_Languages/Bengali-specific-translations.qmd)|
33+
|[Catalan](Conventions_for_Languages/Catalan-specific-translations.qmd)|
34+
|[Chinese](Conventions_for_Languages/Chinese-specific-translations.qmd)|
35+
|[Hindi](Conventions_for_Languages/Hindi-specific-translations.qmd)|
36+
|[Nepali](Conventions_for_Languages/Nepali-specific-translations.qmd)|
37+
|[Portuguese (Brazilian)](Conventions_for_Languages/Brazilian‐Portugese-specific-translations.qmd)|
38+
|[Spanish](Conventions_for_Languages/Spanish-specific-translations.qmd)|
4039

4140
1. You can start translating!
4241

43-
You can check the
44-
[guide](https://contributor.r-project.org/rdevguide/message-translations.html#how-to-contribute-new-translations) on how
45-
Weblate works and check this short [demo](https://www.youtube.com/watch?v=VFwTn32MrBw) on how to use the Weblate
46-
interface. You can also get access to complete documentation of Weblate through this
42+
You can check the
43+
[guide](https://contributor.r-project.org/rdevguide/chapters/message_translations.html#how-to-contribute-new-translations) on how
44+
Weblate works and check this short [demo](https://www.youtube.com/watch?v=VFwTn32MrBw) on how to use the Weblate
45+
interface. You can also get access to complete documentation of Weblate through this
4746
[link](https://docs.weblate.org/en/latest/).
4847

4948
### What is being translated?
5049

51-
All outputs in base R and recommended packages (such as messages emitted by `stop()`,
50+
All outputs in base R and recommended packages (such as messages emitted by `stop()`,
5251
`warning()`, or `message()`) are eligible for translation, as are menu labels in the GUI.
5352

5453
## Roles
5554

56-
We use the [dedicated reviewers](https://docs.weblate.org/en/latest/workflows.html#dedicated-reviewers)
57-
workflow on Weblate. We currently manage 3 roles in the platform. Languages without dedicated reviewers have their
58-
translations directly approved without review.
55+
Languages without an established translation team and so without dedicated reviewers have their translations directly approved without review.
56+
In that perspective, there's a single role for translators, and no reviewers.
5957

60-
### Translators
61-
62-
Every registered user on Weblate can act as a translator. All translations are reviewed unless there is
63-
no reviewer assigned for that language. If you are not sure about a translation you can make a suggestion instead. You
64-
can also use the Glossary to check which terms you shouldn't translate and discuss with the community to add new ones if
65-
you don't find the word you are looking for.
58+
In case a team has been established for a language, we use the [dedicated reviewers](https://docs.weblate.org/en/latest/workflows.html#dedicated-reviewers)
59+
workflow on Weblate, where we currently manage 3 roles in the platform.
6660

67-
### Admins/team leaders
61+
### Translators
6862

69-
Admins/team leaders keep the list of admins and reviewers by language up to date. The team
70-
leader(s) of a particular language is(are) the initial [dedicated
71-
reviewer(s)](https://docs.weblate.org/en/latest/workflows.html#dedicated-reviewers).
63+
Every registered user on Weblate can act as a translator for any language. All translations need to be reviewed unless there is
64+
no reviewer assigned for that language. If you are not sure about a translation, you can make a suggestion instead. You
65+
can also use the Glossary to check which terms you shouldn't translate and discuss with the community to add new ones if
66+
you don't find the word you are looking for.
7267

7368
### Reviewers
7469

75-
Reviewers have an editor role who approves the work of translators and ensures the overall cohesion of the
76-
translation work in one language. For adding new reviewers or peer reviewers to Weblate, please reach out to the
77-
respective team leaders via the `#core-translation` channel on the [R Contributors
70+
Reviewers bear the editor role to approve the work of translators and ensure the overall cohesion of the
71+
translation work in one language. For adding new reviewers for a language, please reach out to the
72+
respective team leaders via the `#core-translation` channel on the [R Contributors
7873
Slack](https://contributor.r-project.org/slack) workspace.
7974

80-
Possible state of a string:
75+
### Team leaders
76+
77+
Team administrators and leaders keep the list of admins and reviewers for a language up to date. The team
78+
leader(s) of a particular language is(are) the initial [dedicated
79+
reviewer(s)](https://docs.weblate.org/en/latest/workflows.html#dedicated-reviewers) as well.
80+
81+
## How to start a new language team
82+
83+
To request the creation of a new language team, please reach out on the `core-translation` channel of the [R Contributors Slack](https://contributor.r-project.org/slack) workspace, and the [administrators of Weblate](https://contributor.r-project.org/translations/Weblate-server.html#administrators) will follow the steps described in the [Weblate server admin page](https://contributor.r-project.org/translations/Weblate-server.html#team-leaders).
84+
85+
In short, a new team will be created for the language with roles to approve translations and edit the language-specific glossary, then you (and others listed as team leaders) will be added to that team so that the dedicated reviewers workflow becomes enforced for that language.
86+
87+
Additionally, language team administrators can be also shortlisted among the reviewers with permissions to add new reviewers to the team, and to manage the team members.
88+
89+
## Translation states
90+
91+
Possible state of a string:
8192

82-
* **Untranslated**: Translation is empty, it might or not be stored in the file, depending on the file format.
83-
* **Needs editing**: Translation needs editing, this is usually the result of a source string
84-
change, fuzzy matching or translator action. **If you are unsure about how to translate something, make a suggestion,**
85-
**do not click the "Needs editing" button**.
86-
* **Waiting for review**: Translation is made, but not reviewed.
87-
* **Approved**:
88-
Translation has been approved in the review. It can no longer be changed by translators, but only by reviewers.
93+
* **Untranslated**: Translation is missing, and might or might not be stored in the translation file.
94+
* **Needs editing**: Translation needs editing. This is usually the result of a source string
95+
change, fuzzy matching or translator action. The `fuzzy` tag might be commited to the translation file. **If you are unsure about how to translate something, make a suggestion instead of clicking the "Needs editing" button**.
96+
* **Waiting for review**: Translation is made, but not reviewed yet.
97+
* **Approved**: Translation has been approved in the review. It can no longer be changed by translators, but only by reviewers. This is also committed to the repository.
8998

9099
## Sustainability of the translations community
91100

@@ -104,7 +113,7 @@ raise awareness about translations.
104113

105114
## Space for feedback
106115

107-
You can open an issue in this repository if you find something that is not working as expected in Weblate. If you want
116+
You can open an issue in this repository if you find something that is not working as expected in Weblate. If you want
108117
to discuss about translations and convictions you can use the Slack channels dedicated to that.
109118

110119
## Resources
@@ -128,5 +137,5 @@ Some interesting guides, glossaries and handbooks:
128137
## Future work
129138

130139
* Explore possible integration of dictionaries into Weblate?
131-
* Add demos from the translator and
140+
* Add demos from the translator and
132141
reviewer's perspective

0 commit comments

Comments
 (0)