You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
198
199
}]
199
200
unlink(filename)
200
201
NULL
@@ -208,7 +209,7 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
@@ -236,20 +237,24 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
236
237
1. Generate a patch file from the diff, going back to the most recent commit with translations merged, e.g.
237
238
238
239
```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"
241
242
```
242
243
243
244
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.
244
245
245
246
## Maintenance
246
247
248
+
### Unlock components
249
+
247
250
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:
248
251
249
252
```sh
250
253
weblate unlock_translation r-project
251
254
```
252
255
256
+
### Git rebase conflicts
257
+
253
258
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:
254
259
255
260
```sh
@@ -309,13 +314,25 @@ Weblate will provide a suggestion on how to fix, but in short:
309
314
./deconflict_add_continue.py weblate
310
315
```
311
316
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.
313
320
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.
315
324
316
325
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).
317
326
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)
319
336
320
337
## Administrators
321
338
@@ -344,3 +361,19 @@ There are language teams defined in each project with the below extra permission
344
361
- Manage translation memory
345
362
346
363
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.
[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
47
46
[link](https://docs.weblate.org/en/latest/).
48
47
49
48
### What is being translated?
50
49
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()`,
52
51
`warning()`, or `message()`) are eligible for translation, as are menu labels in the GUI.
53
52
54
53
## Roles
55
54
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.
59
57
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.
66
60
67
-
### Admins/team leaders
61
+
### Translators
68
62
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
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:
81
92
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.
89
98
90
99
## Sustainability of the translations community
91
100
@@ -104,7 +113,7 @@ raise awareness about translations.
104
113
105
114
## Space for feedback
106
115
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
108
117
to discuss about translations and convictions you can use the Slack channels dedicated to that.
109
118
110
119
## Resources
@@ -128,5 +137,5 @@ Some interesting guides, glossaries and handbooks:
128
137
## Future work
129
138
130
139
* Explore possible integration of dictionaries into Weblate?
0 commit comments