mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Update danger check on translations.
This commit is contained in:
@@ -104,17 +104,11 @@ if (hasPngs) {
|
|||||||
|
|
||||||
// Check that translations have not been modified by developers
|
// Check that translations have not been modified by developers
|
||||||
const translationAllowList = [
|
const translationAllowList = [
|
||||||
"RiotTranslateBot",
|
"ElementBot",
|
||||||
"github-actions[bot]",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!translationAllowList.includes(user)) {
|
if (!translationAllowList.includes(user)) {
|
||||||
if (editedFiles.some(file => file.endsWith("strings.xml") && !file.endsWith("values/strings.xml"))) {
|
if (editedFiles.some(file => file.endsWith("translations.xml"))) {
|
||||||
fail("Some translation files have been edited. Only user `RiotTranslateBot` (i.e. translations coming from Weblate) or `github-actions[bot]` (i.e. translations coming from automation) are allowed to do that.\nPlease read more about translations management [in the doc](https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#internationalisation).")
|
fail("Some translation files have been edited. Only user `ElementBot` (i.e. translations coming from Localazy) is allowed to do that.\nPlease read more about translations management [in the doc](https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#strings).")
|
||||||
}
|
|
||||||
|
|
||||||
// Check that new strings are not added to `values/strings.xml`
|
|
||||||
if (editedFiles.some(file => file.endsWith("ui-strings/src/main/res/values/strings.xml"))) {
|
|
||||||
fail("`ui-strings/src/main/res/values/strings.xml` has been edited. This file will be overridden in the next strings synchronisation. Please add new strings in the file `values/strings_eax.xml` instead.")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user