mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-17 16:11:15 -03:00
This greatly reduces the number of changes necessary to the PO files when the Rust/fish source files are updated. (Changes to the line number can be applied automatically, but this adds a lot of noise to the git history.) Due to the way we have been extracting Rust strings, differentiation between the same source string in different contexts has not been possible regardless of the change. It seems that duplicate msgid entries are not permitted in PO files, so since we do not use context to distinguish the strings we extract, there is no way to have context-/location-dependent translations, so we might as well reduce the git noise by eliminating line numbers. Including source locations helps translators with understanding context. Because we do not distinguish between contexts for a given source string, this is of limited utility, but keeping file names at least allows to open the relevant files and search them for the string. This might also be helpful to identify translations which do not make sense in all context in which they are used. (Although without adding context support, the only remedy would be to remove the translation altogether, as far as I can tell.) For extraction from Rust, additional issues are fixed: - File name extraction from the grep results now works properly. Previously, lines not starting with whitespace resulted in missing or corrupted matches. (missing if the source line contains no colon followed by a whitespace, corrupted if it does, then the match included the part of the line in front of the colon, instead of just the location) - Only a single source location per string was supported (`head -n1`). The new approach using sed does not have this limitation.