mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Merge pull request #3920 from vector-im/feature/bma/string_cleanup
Improve documentation about string resource
This commit is contained in:
commit
8189fc0b66
2 changed files with 27 additions and 2 deletions
|
@ -116,9 +116,34 @@ You should consider adding Unit tests with your PR, and also integration tests (
|
|||
|
||||
### Internationalisation
|
||||
|
||||
When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators with a specific tool named [Weblate](https://translate.riot.im/projects/riot-android/).
|
||||
Translations are handled using an external tool: [Weblate](https://translate.element.io/projects/element-android/)
|
||||
|
||||
As a general rule, please never edit or add or remove translations to the project in a Pull Request. It can lead to merge conflict if the translations are also modified in Weblate side.
|
||||
|
||||
#### Adding new string
|
||||
|
||||
When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators using Weblate.
|
||||
|
||||
New strings can be added anywhere in the file `value/strings.xml`, not necessarily at the end of the file. Generally, it's even better to add the new strings in some dedicated section per feature, and not at the end of the file, to avoid merge conflict between 2 PR adding strings at the end of the same file.
|
||||
|
||||
Do not hesitate to use plurals when appropriate.
|
||||
|
||||
#### Editing existing strings
|
||||
|
||||
Two cases:
|
||||
- If the meaning stays the same, it's OK to edit the original string (i.e. the English version).
|
||||
- If the meaning is not the same, please create a new string and do not remove the existing string. See below for instructions to remove existing string.
|
||||
|
||||
#### Removing existing strings
|
||||
|
||||
If a string is not used anymore, it should be removed from the resource, but please do not remove the strings or its translations in the PR. It can lead to merge conflict with Weblate, and to lint error if new translations from deleted strings are added with Weblate.
|
||||
|
||||
Instead, please comment the original string with:
|
||||
```xml
|
||||
<!-- TO BE REMOVED -->
|
||||
```
|
||||
The string will be removed during the next sync with Weblate.
|
||||
|
||||
### Accessibility
|
||||
|
||||
Please consider accessibility as an important point. As a minimum requirement, in layout XML files please use attributes such as `android:contentDescription` and `android:importantForAccessibility`, and test with a screen reader if it's working well. You can add new string resources, dedicated to accessibility, in this case, please prefix theirs id with `a11y_`.
|
||||
|
|
|
@ -224,7 +224,7 @@ public class BugReporterMultipartBody extends RequestBody {
|
|||
}
|
||||
|
||||
public static Part createFormData(String name, String value) {
|
||||
return createFormData(name, null, RequestBody.create(null, value));
|
||||
return createFormData(name, null, RequestBody.create(value, null));
|
||||
}
|
||||
|
||||
public static Part createFormData(String name, String filename, RequestBody body) {
|
||||
|
|
Loading…
Reference in a new issue