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

Fix locales with special dialogs #70

Merged
merged 3 commits into from
Aug 6, 2024
Merged

Fix locales with special dialogs #70

merged 3 commits into from
Aug 6, 2024

Conversation

danirod
Copy link
Owner

@danirod danirod commented Aug 6, 2024

Some dialogs were not being translated and in this PR I add fixes for that.

  • The AboutDialog is an Adwaita system dialog, but it wasn't being localized on Windows or macOS ("About Window" Does not change language #56). This was not happening on GNU/Linux and on macOS if libadwaita is still installed via Homebrew. It turns out that if you have dependencies with locale files, you have to distribute them with your app, otherwise the strings will not be present.
  • While I'm on this, it seems that I forgot to add the shortcuts dialog to the POTFILES.in file, so the strings in that file were never proposed for localization. This PR also adds the file to the POTFILES and provides strings in Spanish.

danirod added 3 commits August 6, 2024 10:19
It turns out that dependencies have their own locale files, and this may
explain why the load and save dialog on Microsoft Windows always used
the English messages for the Cancel button, or why the About Dialog was
not translated only on Microsoft Windows.

This commit patches the msys-build.sh script so that third party locales
are copied when creating a binary distribution for Microsoft Windows.

This commit also patches main.rs so that when running the application on
Windows, libadwaita is rebound again to the proper directory, for
reasons stated in the comment I've added on top of the block.
It turns out that I forgot to add this file to the POTFILES, therefore
the commands would never pick the strings in this file in first place,
so they are always presented in English.
Same thing, the locales have to be packed so that it works without
Homebrew installed because apparently libadwaita also hardcodes the path
there (I suppose that it is hardcoded to /opt/homebrew/share/locale).
@danirod danirod added the Pending backport The pull request needs to be backported to older versions label Aug 6, 2024
@danirod danirod self-assigned this Aug 6, 2024
@danirod danirod merged commit 9bf8920 into trunk Aug 6, 2024
2 checks passed
@danirod danirod deleted the fix-adwaita-locale branch August 6, 2024 08:46
Phosphorus-M pushed a commit to Phosphorus-M/cartero that referenced this pull request Sep 8, 2024
@danirod danirod removed the Pending backport The pull request needs to be backported to older versions label Oct 11, 2024
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.

1 participant