summaryrefslogtreecommitdiffhomepage
path: root/android/translations-converter/src
AgeCommit message (Collapse)AuthorFilesLines
2025-07-10Run `cargo fmt`Sebastian Holmin2-2/+2
2025-07-09Remove trailing whitespaceSebastian Holmin1-3/+3
2025-07-09Inline format argumentsLinus Färnstrand3-7/+7
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öm4-72/+154
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 Rhodin7-45/+240
2025-03-24Prevent duplicate string values in Android xmlDavid Göransson1-0/+28
2024-11-14Update android gui referencesOskar1-1/+1
2024-08-27Use std LazyLock instead of once_cell LazyDavid Lönnhager2-10/+11
2024-08-21Support generating relay locationsDavid Göransson1-5/+108
2024-04-03Enable single-use-lifetimes rustc lintLinus Färnstrand1-1/+1
Removes superfluous lifetime definitions. Simplifying the code
2024-02-27Replace err_derive with thiserrorJoakim Hulthe3-20/+14
`err_derive` is unmaintained and will probably stop working with rust edition 2024. `thiserror` is almost a drop-in replacement. This commit simply replaces all occurences of `derive(err_derive::Error)` with `derive(thiserror::Error)` and fixes the attributes, but the Error and Display impls should be identical.
2024-02-08Fix `clippy` lint `ineffective_open_options`Markus Pettersson1-4/+1
This new `clippy` lint was introduced in the latest Rust release (1.76).
2024-01-04Add workspace level lintsLinus Färnstrand1-2/+0
2023-08-04Replace all use of `lazy_static` with `once_cell`Markus Pettersson2-19/+10
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-08-03Migrate translation-converter to err_deriveLinus Färnstrand3-24/+27
2023-07-27Update translations coverter with new resource pathAlbin1-1/+1
2023-05-23Make Android translations-converter compat with rust_2018_idiomsLinus Färnstrand4-8/+8
2023-05-23Deny rust 2018 idioms in translations-converterLinus Färnstrand1-0/+2
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.
2023-01-31Replace serde-xml-rs with quick-xml in translations-converterLinus Färnstrand4-5/+12
2023-01-30Run `cargo clippy --fix` with the new Rust 1.67 preferred formatLinus Färnstrand6-16/+16
2022-12-21Fix rust formattingAlbin1-2/+1
2022-12-21Apply more clippy fixes.Emīls2-4/+2
2022-10-05Prevent normalization of apostrophes in translation-converterOskar Nyberg1-4/+1
2022-09-27Fix clippy complaintsEmīls Piņķis1-1/+1
2022-08-29Fix Clippy errorsDavid Lönnhager1-2/+2
2022-07-05Fix unnecessary allocsDavid Lönnhager1-2/+2
2022-06-21Fix the large majority of clippy warningsJonathan1-7/+0
This commit fixes most of the remaining clippy warnings in the codebase. These warnings were the more semantically difficult ones to fix. There are some warnings that remain from the rebase that will be fixed in the upcoming PR.
2022-06-13Perform a clippy --fixjonathan3-14/+11
This is a giant commit which performs only a clippy --fix. Auditing can happen in two ways, either by reading every line or by running a `cargo clippy --fix` on the previous commit and make sure that the result is the same.
2022-05-13Remove unused macro expressionsEmīls1-50/+0
With the advent of the latest nightly, the unused macro expressions are producing warnings, which fail the CI. So the unused expressions are removed, and can be added back if they are ever required again.
2021-12-16Split Android project and app moduleAlbin1-1/+1
The purpose of this is to: * Comply better with the default Android project structure (see https://developer.android.com/studio/build). * Avoid conflicts between project and app dependencies and plugins.
2021-10-07Remove logic for generating translated URLsAlbin1-37/+2
2021-05-28Remove obsolete `parse_line` helper functionJanito Vaqueiro Ferreira Filho1-11/+0
Replaced by the new `match_str!` macro implementation.
2021-05-28Fix handling of multi-line messagesJanito Vaqueiro Ferreira Filho1-15/+162
A message string can be split among multiple lines, and this was not properly handled. Now it is handled by separate states that join all the lines it finds related to the message.
2021-05-28Test `MsgString` concatenationJanito Vaqueiro Ferreira Filho1-0/+36
Test by moving the operands and by borrowing them. Also test appending to a `MsgString`.
2021-05-28Implement `Add` for `MsgString`Janito Vaqueiro Ferreira Filho1-1/+21
Allow joining two `MsgString`s, either by moving them or by borrowing them.
2021-05-28Implement `AddAssign` for `MsgString`Janito Vaqueiro Ferreira Filho1-1/+16
Allowing appending to a `MsgString`.
2021-05-28Refactor parser into a clearer state machineJanito Vaqueiro Ferreira Filho1-73/+322
Make it more robust, maintainable and readable.
2021-05-28Return errors from parser methodsJanito Vaqueiro Ferreira Filho2-22/+50
Avoid panicking inside of `Parser`.
2021-05-28Derive `Eq` and `PartialEq` for `MsgString`Janito Vaqueiro Ferreira Filho1-1/+1
This is to allow `Eq` to be derived for the future `gettext::parser::Error` type.
2021-05-28Move `Parser` into a separate moduleJanito Vaqueiro Ferreira Filho3-109/+145
Prepare for refactoring the parsing logic to improve readability and maintainability.
2021-05-28Add `Messages::add_plural` helper methodJanito Vaqueiro Ferreira Filho1-0/+10
Adds plural entries.
2021-05-28Add `Messages::add` helper methodJanito Vaqueiro Ferreira Filho1-0/+10
Adds non-plural message entries.
2021-05-28Add `Messages::starting_with` constructorJanito Vaqueiro Ferreira Filho1-0/+15
Helper constructor to create the instance with an initial entry.
2021-05-28Implement `FromStr` for `PluralForm`Janito Vaqueiro Ferreira Filho1-0/+19
Makes it simpler to obtain an error when attempting to create an instance from a formula string.
2021-05-28Add `Messages::with_plural_formula` constructorJanito Vaqueiro Ferreira Filho1-0/+8
Helper method to parse a specified plural formula in order to create a new empty `Messages` list with the plural form configured.
2021-05-28Return result from `gettext::Messages::from_file`Janito Vaqueiro Ferreira Filho2-10/+21
Instead of panicking on error.
2021-05-28Move `Messages` and related types to new moduleJanito Vaqueiro Ferreira Filho2-162/+173
2021-05-28Rename `Translations` into `Messages`Janito Vaqueiro Ferreira Filho2-6/+6
Because it's also used for the messages template file.