Site | GitHub | API | Coverage Report
Note: This is a work in progress, and is not yet ready for general use.
Despite the test suite, not all functionality has been tested, and there are likely to be bugs.
lingora is a free and open-source localization management program that analyses fluent translation files highlighting discrepancies between reference and target language files.
lingora is designed primarily to be used as a command line tool, but also provides a graphical user interface.
linux | macos | windows
Packaged builds have not been tested; links are provided in the latest github build, so
check the latest Build Dioxus Desktop App
action for those, or (preferably at the moment)
build from source.
There will be ongoing development, particularly in cross-checks between reference and target files.
Please report any issues or feature requests on the GitHub Issues
lingora compares the entries of a reference translation file against one or more target translation files.
A Lingora.toml
file can be used to define the reference translation file, and target translation files (or search
paths).
If the Lingora.toml
file exists in the current working directory then it will be used. An explicit config
file can be provided using the --config=path/to/your-config.toml
command line argument. If no config file exists
then sensible defaults will be used.
It is recommended that projects provide an explicit Lingora.toml
file minimally specifying the reference translation
file so that all other files are compared against it, rather than the locale of a user’s workstation, which would
vary from user to user.
By default (i.e., no toml
file exists, or is specified) lingora will look for the translation files in ./i18n/
and it will use <current_system_locale>.ftl
as the reference translation file.
Command line arguments can be used to override config file settings, with -r path/to/reference_file.ftl
and
-t path/to/target_file.ftl
command line arguments. -t
may also specify a folder, in which case all *.ftl
files under that folder will be used as targets. The reference and target file names are expected to use the <language>-<locale>
naming convention.
lingora can create a config.rs
source file containing a function to create an I18nConfig
for the dioxus-i18n crate.
A GUI interface, to browse files can be invoked with the --output=gui
or -o gui
command line argument.
To list help:
lingora --help
The default run looks at all ftl files in the ./i18n/
folder, looking for a <current_system_locale>.ftl
for the reference file.
Only one <current_system_locale>.ftl
must exist for this command to run successfully. Output is to stdout
.
lingora
# or, by redirecting stdout:
lingora > i18n-errors.txt
To get the result of an analysis, but not see the details use the --output=silent
option. This command does not output anything
unless there are inconsistencies in or between the reference and/or target folders, in which case an error return of
Error: IntegrityErrorsDetected
is displayed.
lingora -o silent
To specify the reference locale: note this looks for target ftl files in the ./i18n/
folder.
lingora -r ./i18n/en/en-GB.ftl
To specify reference and target(s): note -t ...
can be a folder, in which case a deep search for all .ftl
files within the folder is performed.
lingora -r ./i18n/en/en-GB.ftl -t ./i18n/en/en-AU.ftl -t ./i18n/it/it.ftl
To output an opininated I18nConfig initialisation function: Output is to the provide path. The output settings can be modified in the Lingora.toml configuration file.
lingora --dioxus-i18n=path/to/your_i18n_config.rs
To use a config file, other than ./Lingora.toml. Note, if Lingora.toml
exists
in the current working directory, then it will be used by default without specifying explicitly in this
command line argument.
lingora --config=path/to/your_config.toml
The override the default root folder (./i18n/
). Note any default root folder is
not used if any targets (--target=...
/ -t ...
) are provided.
lingora --root=path/to/your_root_folder
To run the desktop application, use the --output=gui
option:
lingora -o gui
cargo test
cargo llvm-cov
Module | Description | Notes |
---|---|---|
root | Root module | |
config | Interpret command line arguments and Lingora.toml file |
1 |
domain | Domain logic | 2 |
domain/fluent | Fluent file handling | |
domain/integrity | Integrity checking data structures | |
gui | Graphical user interface | 3 |
output | Output handling | 4 |
config
module is responsible for interpreting the command line arguments and the Lingora.toml
file.
The Lingora.toml
file can be in the current working directory, or specified with the --config=path/to/your-config.toml
argument.
arguments.rs
is the structure populated by clap.
interim_settings.rs
is built from the Lingora.toml
config file sourced from:
Lingora.toml
file in the current working directory, or, if not provided.settings.rs
is the final settings used by the program, which are built from interim_settings.rs
and arguments.rs
.The domain
module is responsible for the core logic of the program.
It compares the reference and target files, and creates the resultant integrity checks.
analysis.rs
is the resultant analysis of all files, as formed from their respective integrity checks and cross-checks.
The gui
module is responsible for the graphical user interface.
components
contains the various components used in the GUI.
state.rs
is the user interaction and subseqent current selections.
output
module provides formatted output of the analysis and output of the I18nConfig function call.cargo binstall dioxus-cli
dx build --release
# dx bundle // Still in development