In this movie, the author shares a simple formula for how you can know whether or not it’s appropriate to internationalize your code. Should you choose to, she covers some WordPress best practices to keep in mind when writing code. These best practices make your code easier to work with and translate.
- In this movie, we're gonna look at some Best Practices…for internationalizing your code.…But before we do that, I want to answer this question.…Do you always need to internationalize your code?…Since this is a course on internationalization,…you might think I'm gonna say yes,…but actually the answer is, it depends.…If you plan on distributing your code,…then 100% yes, absolutely internationalize it.…What do I mean by distribute?…I mean that if you plan to put your code…in the WordPress repository, make it available on GitHub,…sell it in the form of a theme or plugin,…or otherwise make your code accessible to the public,…then most definitely internationalize it.…
Doing that ensures that anyone who gets ahold of your code…can localize it when needed.…It makes your code accessible…to the widest possible audience.…Now, if you're creating a custom theme or plugin,…for use on a client site, or maybe personal use,…and it's code that will never really see the light of day,…then you don't necessarily need to internationalize it.…
- Why internationalization is important
- Using the gettext() function
- Adding context for translations
- Adding and loading text domains for WordPress themes and plugins
- Translating using GlotPress