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

Automatic localization compilation #9

Open
2 tasks done
Noxgrim opened this issue Jan 10, 2020 · 0 comments
Open
2 tasks done

Automatic localization compilation #9

Noxgrim opened this issue Jan 10, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Noxgrim
Copy link

Noxgrim commented Jan 10, 2020

Checklist

  • I've verified that I use the latest version of aab
  • I've checked if anyone else suggested this feature before by looking through the issue reports.

Problem case

Currently gettext localization files (.po files) in the addon are only copied (if they are located in the src directory).

But Python's gettext module can only read the compiled version of these files (.mo files).

Solution

My solution:

aab should compile any .po file encountered automatically and only add resulting .mo files at the same position to the built addon. The .po files should not be added.

Alternatives I have though of:

Currently the only alternative for the user is to compile the files before the addon is built, maybe committing the unreadable binary .mo files in the process, or compile them after the addon is already built, either by awkwardly editing the zip file or by editing the files after Anki installed them.
In all cases all localization files have to be compiled one by one.

Maybe the user could use a shell script to automate the process, but in that case the modifications still have to be done at a position where they seem unreasonable for me, because source files and the built (and compiled) addon are not clearly separated.

More information

This issue is directly correlated with
glutanimate/image-occlusion-enhanced#124
and the corresponding PR
glutanimate/image-occlusion-enhanced#125

@Noxgrim Noxgrim added the enhancement New feature or request label Jan 10, 2020
@Noxgrim Noxgrim changed the title Auromatic localization compilation Automatic localization compilation Jan 10, 2020
Noxgrim added a commit to Noxgrim/anki-addon-builder that referenced this issue Jan 11, 2020
This fixes glutanimate#9

+ Add new 'check_exists' function to 'utils.py'
+ Add '_build_locales' method to 'builder.py'
+ Add section describing the new feature to 'README.md'
Noxgrim added a commit to Noxgrim/anki-addon-builder that referenced this issue Aug 16, 2023
This fixes glutanimate#9

+ Add new 'check_exists' function to 'utils.py'
+ Add '_build_locales' method to 'builder.py'
+ Add section describing the new feature to 'README.md'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant