-
Notifications
You must be signed in to change notification settings - Fork 52
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
make-mo
: Add option to specify filename
#372
Comments
I‘d be open for a PR that provides an option to override the name. But why not just rename the PO file? |
Yeah, a rename would solve the issue, true. I thought the convention was to include the plugin/theme name, though - I don't know why I think that, I found e.g. https://developer.wordpress.org/plugins/internationalization/localization/#translate-the-po-file now... |
If you provide your own translation files, the file name convention is |
Thanks, didn't know that. Then I'll solve my immediate issue by renaming the po files, however, I still think a (probably more general) option to set the file names could be useful... |
@swissspidy I've looked into adding the option of overriding the file name, however given that the command also supports converting all files from a directory and in that case the name override would not make much sense. I'm not sure if adding an option to override the filename that only works when you pass file would make much sense, would appreciate any feedback. |
That's a good point. I suppose it could still work though, just like Here, we could just enhance Example:
Does that make sense? The alternative is to just close this as a wontfix, as this can also be achieved through other means like simply renaming files afterwards. |
Hi, |
Agreed that this would be too complex. You can use one of the many shell commands out there to mass-rename files instead. Or better yet, fix the name of your PO files to actually match what WordPress expects :) |
Feature Request
Describe your use case and the problem you are facing
I'm localizing a WordPress theme that unfortunately cannot be hosted on WP.org due to organisation policy. I am trying to migrate from a collection of tools to the i18n command. I need to create
.mo
file to be loaded withload_theme_textdomain()
. My.po
files are called liketheme-slug-cs_CZ.po
(so theme slug + locale name), however, theload_theme_textdomain()
function requires the.mo
file to be called justcs_CZ.mo
(so just locale name). This requires me to strip the theme slug from all.mo
filesDescribe the solution you'd like
I'd like to see the option to use just the locale name for the
make-mo
commandThe text was updated successfully, but these errors were encountered: