mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 12:21:19 -03:00
l10n: move po/ to localization/po/
This is done in preparation for Fluent's FTL files, which will be placed in `localization/fluent/`. Having a shared parent reduces top-level clutter in the repo and makes it easier to find the localization files for translators, including realizing that both PO and FTL files exist. We keep PO and FTL files in separate directories because we need to rebuild on any changes in the PO directory (technically only when there are changes to `*.po` files, but due to technical limitations we can't reliably trigger rebuilds only if those changes but not other files in the same directory.) Changes to FTL files do not require rebuilds for dev builds, since for these `rust-embed` does not actually embed them into the binary but rather loads them from the file system at runtime. Closes #12193
This commit is contained in:
committed by
Johannes Altmanninger
parent
1ebf750bc0
commit
9b75b6ee88
@@ -11,7 +11,11 @@ fn main() {
|
||||
PathBuf::from(fish_build_helper::fish_build_dir()).join("fish-localization-map-cache");
|
||||
embed_localizations(&cache_dir);
|
||||
|
||||
fish_build_helper::rebuild_if_path_changed(fish_build_helper::workspace_root().join("po"));
|
||||
fish_build_helper::rebuild_if_path_changed(
|
||||
fish_build_helper::workspace_root()
|
||||
.join("localization")
|
||||
.join("po"),
|
||||
);
|
||||
}
|
||||
|
||||
fn embed_localizations(cache_dir: &Path) {
|
||||
@@ -21,7 +25,9 @@ fn embed_localizations(cache_dir: &Path) {
|
||||
io::{BufWriter, Write},
|
||||
};
|
||||
|
||||
let po_dir = fish_build_helper::workspace_root().join("po");
|
||||
let po_dir = fish_build_helper::workspace_root()
|
||||
.join("localization")
|
||||
.join("po");
|
||||
|
||||
// Ensure that the directory is created, because clippy cannot compile the code if the
|
||||
// directory does not exist.
|
||||
@@ -41,7 +47,7 @@ fn embed_localizations(cache_dir: &Path) {
|
||||
"Could not find msgfmt required to build message catalogs. \
|
||||
Localization will not work. \
|
||||
If you install gettext now, you need to trigger a rebuild to include localization support. \
|
||||
For example by running `touch po` followed by the build command."
|
||||
For example by running `touch localization/po` followed by the build command."
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user