summaryrefslogtreecommitdiffhomepage
path: root/android/translations-converter/src/normalize.rs
AgeCommit message (Collapse)AuthorFilesLines
2025-06-30Fix issue with normalization in the translation scriptJonatan Rhodin1-2/+6
2025-05-28Fix arg order lost when adding to messages.potKalle Lindström1-0/+12
Currently when we add new strings from strings.xml in the android app and these gets added to message.pot by the translation script the arguments get added only as "%s" and "%d" and any ordering is lost. This means that if you would add a string to the android app that is something like "%1$s %2$s %1$s" this would be added to messages.pot as msgid "%s %s %s" and it would treat it as the string has 3 different arguments instead of 2. This PR changes the code so that when the Android strings.xml strings are added to messages.pot the argument index (if it exists) is not removed as it was previously. So the Android string "%1$s %2$s %1$s" will now result in the exact same string being added to messages.pot. However, the current normalizaion behavior is kept when it comes to checking if an Android string already exists in messages.pot, so e.g. the string `"Not all our servers are %1$s-enabled. Therefore, we use multihop automatically to enable %1$s with any server."` will still match the current value in the pot file which is: `"Not all our servers are %(daita)s-enabled. Therefore, we use multihop automatically to enable %(daita)s with any server."` and no new string is added to messages.pot.
2025-04-04Add support for different orderings of arguments for translationsJonatan Rhodin1-5/+8
2024-08-27Use std LazyLock instead of once_cell LazyDavid Lönnhager1-7/+7
2023-08-04Replace all use of `lazy_static` with `once_cell`Markus Pettersson1-11/+7
To align more with the upcoming standardizations within the Rust ecosystem which started with the release of `1.70.0` and the inevitable deprecation of `lazy_static`.
2023-03-13Update htmlize to version 1.0Daniel Parks1-1/+1
The htmlize API changed slightly for improved performance and build times. This just updates android/translations-converter to stay current. All android/translations-converter tests pass.
2022-10-05Prevent normalization of apostrophes in translation-converterOskar Nyberg1-4/+1
2022-08-29Fix Clippy errorsDavid Lönnhager1-2/+2
2021-05-21Fix normalize single-quotes testJanito Vaqueiro Ferreira Filho1-4/+6
2021-05-21Unescape single quotes in gettext messagesJanito Vaqueiro Ferreira Filho1-0/+3
2021-05-19Test normalization of gettext `MsgString`Janito Vaqueiro Ferreira Filho1-0/+19
2021-05-19Test normalization of `StringValue`Janito Vaqueiro Ferreira Filho1-0/+24
2021-05-19Move collapsing line breaks to constructorJanito Vaqueiro Ferreira Filho1-4/+1
This is because the removal of line breaks is not part of the normalization but part of initial conditioning of the input.
2021-05-19Implement `Normalize` for `gettext::MsgString`Janito Vaqueiro Ferreira Filho1-0/+24
2021-05-19Implement `Normalize` for `android::StringValue`Janito Vaqueiro Ferreira Filho1-0/+31
2021-05-19Create a new `Normalize` traitJanito Vaqueiro Ferreira Filho1-0/+6
Place it in a new `normalize` module so that the all normalization code is in a single module. This helps to make sure the normalized common format is respected by all implementations.