pub enum FtlOutputOptions {
MultiFile {
output_ftl_folder: String,
},
SingleFile {
output_ftl_file: String,
compressor: Option<Box<dyn Fn(Vec<u8>) -> Result<Vec<u8>, Box<dyn Error>>>>,
},
}
Expand description
The ftl output options for the build command. This allows you to configure how the output ftl files are generated, and also what type of access code is generated.
Defaults to a SingleFileOptions with the output_ftl_folder set to “gen” and gzip set to true.
Variants§
MultiFile
Generates FTL files as one file per language which means that individual resource files are appended into one file.
This is especially useful client-side when you don’t want to embed the files in the binary or download them all together.
Fields
SingleFile
Generates FTL files as one file for all languages, which means that individual resource files are appended into one file.
This is preferred for when you embed the files in your binary which typically is done server-side and also client-side when the files are small enough to either embed in the binary or download in a html request.
Fields
output_ftl_file: String
The path to the where the output ftl file will be written. For convenience fluent-typed joins all ftl resources for each language into a single file.
Defaults to “gen/translations.ftl” in the root of the package.
compressor: Option<Box<dyn Fn(Vec<u8>) -> Result<Vec<u8>, Box<dyn Error>>>>
The compresssor is an closure that takes the ftl file content as a byte array, compresses it and returns the compressed bytes.
Any compression algorithm can be used, but it’s up to the user to import the necessary crate and do the compression and when using it decompress in the same manner.