-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Text Domain Shouldn't be a Variable #59
Comments
Really! I didn't attempt it. |
Hi Devin, I am not completely convinced. The original idea came from Mark. From the blog post.
The way I have experienced it, it is not necessary. When I generate a pot file either with poedit or makepot.php I do not need to enter the Text Domain. The pot file generation is constrained to the folders. WooCommerce has two pot files one for back end text and one front end. This is done by restricting the pot generation to certain folders. The makepot file. The text domain is then defined by the plugin and at the same time the location of the .mo file. This is a snippet from the bottom of the post.
This post was written on October 6, 2011 just under two years ago. At the moment only the plugins have a method to generate a pot file on WordPress.org, themes do not. I have never studied programming so I don't know much about future proofing software. One question that that I ask is "Do you really support something that does not exist and there is no concrete plan to build it." If there was to be an issue for such an automated process the boilerplate could easily be updated just like if there was a new feature in the core that plugins could use. Wysija have an automated solution for packing the plugin with the latest translations. And they also use variables for their textdomain.
My question to your statement: "Please show me an example of code where an issue occurs?" Edit: I would also like to add the link of those who are also not convinced. |
+1 on this ticket. If Otto, Nacin, and Mark all say a particular way to do it, I'm inclined to follow that. They have good reasons for suggesting we build plugins and themes this way too. (all linked above) |
You could be right @grappler. I was reposting the advice I've read from Otto, Mark, and Nacin. I didn't realize there was a contrary opinion from Scribu, Nickolay and Tadlock. If makepot.php and poedit can handle the translations fine with a variable- it seems like all the bases are covered at the moment. If a new programmatic translation tools come out, I agree, it would be easy to update. But since this is intended to be a boilerplate of best practices, it's probably worth having the discussion. If translation tools come out that will cause everyone to need to update their plugins, is it worth the time/effort saved by having a variable textdomain? |
This has actually been a point of discussion very early on in the first iteration of the boilerplate. As we all know, it boils down to:
Because different people have differing opinions on this and different tools manage this stuff differently, perhaps the best thing to do is provide a level of documentation about this based on YMMV on the tool that you use? |
For now, I think we're going to move forward with using a variable for the plugin domain. If someone raises an issue about or has the inability to translate the strings with his/her tools, then we can update this. I can also update the |
Variables for the text domain seems like a great idea, but it causes issues.
See: https://twitter.com/nacin/status/194635610785447938
From Otto: "that text domain must be a plain string. Not a variable. Not a define."
http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/
And Mark Jaquith:
http://markjaquith.wordpress.com/2011/10/06/translating-wordpress-plugins-and-themes-dont-get-clever/
Let me know if you'd like a pull request for this.
The text was updated successfully, but these errors were encountered: