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

Use text domain for translation file names #103

Closed
swissspidy opened this issue Nov 9, 2018 · 2 comments · Fixed by #130
Closed

Use text domain for translation file names #103

swissspidy opened this issue Nov 9, 2018 · 2 comments · Fixed by #130
Labels
[Type] Enhancement New functionality
Milestone

Comments

@swissspidy
Copy link
Collaborator

Issue Overview
As reported in #100, Traduttore creates translation files with names like <project-slug>.mo.

The project slug in GlotPress and the actual slug of the WordPress plugin or theme can be different.

So if your GlotPress project's slug is example-corp/example-plugin, but the plugin's actual slug (and thus text domain) is just example, Traduttore creates example-plugin.mo while WordPress is looking for example.mo.

As suggested in #100 (comment) we should determine the text domain upon POT file generation / translation import and save that information in the database.

After that, when generating the language packs we use that text domain for the file names.

Additional context
#100.

@swissspidy swissspidy added the [Type] Enhancement New functionality label Nov 9, 2018
@swissspidy swissspidy added this to the 3.0.0 milestone Nov 10, 2018
swissspidy added a commit that referenced this issue Nov 12, 2018
Extends the `Project` class so that the project's text domain can be stored in the database.

The text domain is set whenever translations for a project are updated.

It is then used when building language packs, where the text domain is used for the file name of the `.po` und `.mo` files.

Fixes #103.
@swissspidy
Copy link
Collaborator Author

Looks like #107 uses the project's text domain for the file name but omits the locale in the process 🤦‍♂️

Will look into this as part of #108.

@swissspidy swissspidy reopened this Nov 19, 2018
@ocean90
Copy link
Member

ocean90 commented Nov 21, 2018

Do you think it's possible to fix this also without #108? It's a bit unfortunate for users who are using the current master branch as it generates broken language packs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement New functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants