Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .po file creation to Localization doc #13873

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Nov 5, 2024

Since commit 487d45c, meson setup will error out if a project has an i18n configuration but is missing the necessary set of .po files. (Previously, because it wasn't tracking those files the build could be configured first, then the files generated by building the -update-po target.)

Since that no longer works, document the need to create empty .po files in advance, and provide a simple Bourne-shell-compatible command that can be used for this purpose.

Fixes #12368


Note: I don't love this at all; it feels incredibly clunky. But the changes in #9074, which were made for good reason and solved lots of other problems, had a side-effect that existing .po files are (newly) required in order to successfully configure a build. So, this IS now the necessary process, unless someone can come up with a better one. At least this way it's documented.

cc: @eli-schwartz

Since commit 487d45c, `meson setup` will error out
if a project has an i18n configuration but is missing
the necessary set of `.po` files. (Previously, because
it wasn't tracking those files the build could be
configured first, then the files generated by building
the -update-po target.)

Since that no longer works, document the need to
create empty `.po` files in advance, and provide a
simple Bourne-shell-compatible command that
can be used for this purpose.

Fixes mesonbuild#12368
@eli-schwartz
Copy link
Member

Note: I don't love this at all; it feels incredibly clunky. But the changes in #9074, which were made for good reason and solved lots of other problems, had a side-effect that existing .po files are (newly) required in order to successfully configure a build. So, this IS now the necessary process, unless someone can come up with a better one. At least this way it's documented.

One possible option is to ignore missing locales during configuration but have the update-po targets create them and then touch the build configuration.

I also wonder whether it would be practical to make use of subninja to allow handling translations as a dynamically updatable build node and have update-po handle that directly.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Nov 5, 2024

@eli-schwartz

One possible option is to ignore missing locales during configuration but have the update-po targets create them and then touch the build configuration.

Hm! That's interesting. I mean, my initial reaction is that it sounds like a kludge, but... still LESS of one than the current situation, so hey.

Seems like wiring up the dependencies could be tricky — you'd want to make the file-creation step dependent on the LINGUAS file (assuming the list of languages is being pulled from there), so that if it changes any newly-needed files are generated. But you'd only want to touch the config if you actually generate any new files, to avoid endless reconfigurations.

And you'd still have the issue that the files aren't tracked until you run the -update-po target. So if you (say) configured, built, and installed a project without ever running -update-po, Meson would have no idea that it's not generating, using, or installing any translations... right?

(Also, mark my words, within a month of something like that being merged, a bug will get opened complaining that Meson spontaneously reconfigures itself after the -update-po target is run for the first time. 😁)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'meson setup' with i18n module requires initial .po files
2 participants