Commit Graph

83 Commits

Author SHA1 Message Date
Dion Hulse 8da6cfb9fc Theme Translations: Allow for theme pomo files to be loaded from WP_LANG_DIR/themes/{$domain}-{$locale}.(p|m)o.
This directory format is what we have chosen for Language Packs (See #18200), but which is currently delayed.

By making this change, we can ship localised theme files within core for bundled themes, and avoid the issues associated with Theme Updates overwriting/removing the language files.

Fixes #18960



git-svn-id: https://develop.svn.wordpress.org/trunk@22346 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-31 21:30:33 +00:00
Ryan Boren 71d196340b Avoid 'Only variables should be assigned by reference' warning. Props knutsp. fixes #22013
git-svn-id: https://develop.svn.wordpress.org/trunk@22113 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-04 18:09:30 +00:00
Ryan Boren 879cb8231b Remove unnecessary return by refs. Props wonderboymusic. fixes #21839
git-svn-id: https://develop.svn.wordpress.org/trunk@21792 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-10 17:00:11 +00:00
Andrew Nacin e6112c2845 Load the admin MO file on repair.php. props SergeyBiryukov. see #21039 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@21109 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-25 20:00:31 +00:00
Ryan Boren ab8a4b7844 Exclude admin pot files when calculating the list of installed languages in get_available_languages(). fixes #20676
git-svn-id: https://develop.svn.wordpress.org/trunk@20788 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-14 17:58:06 +00:00
Andrew Nacin 0d433cf2aa Allow nooped plurals to receive a textdomain on registration to then be used on translation.
This is good for when the code registering the plural is not also translating it. This occurs
in core with register_post_status(), which accepts a nooped plural as an argument, and then
calls translate_nooped_plural() without a domain.

translate_nooped_plural() can still be called with a domain. The argument will just be overridden
if the nooped plural contains a domain key.

fixes #20188.



git-svn-id: https://develop.svn.wordpress.org/trunk@20648 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-30 16:18:35 +00:00
Ryan Boren 4b5b2e4658 Load the new admin and network admin mo files, if present. see #19852
git-svn-id: https://develop.svn.wordpress.org/trunk@19772 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-27 22:19:56 +00:00
Andrew Nacin 01f19e3cff Check get_site_option(WPLANG) when WP_INSTALLING in mulitiste, just not the blog's option. fixes #18783.
git-svn-id: https://develop.svn.wordpress.org/trunk@19059 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-25 05:09:03 +00:00
Andrew Nacin 90f95e0204 new does not require by reference.
git-svn-id: https://develop.svn.wordpress.org/trunk@18995 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-18 20:20:59 +00:00
Ryan Boren 319d070078 Introduce wp_get_db_schema() for rerieving the various flavors of the WP db schema. Eliminates need to use global. Allows multiple calls to wpmu_create_blog(). see #12028
git-svn-id: https://develop.svn.wordpress.org/trunk@18899 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-06 00:21:24 +00:00
Ryan Boren 4e081d3171 phpdoc typo and readability fixes. Props SergeyBiryukov. fixes #18560
git-svn-id: https://develop.svn.wordpress.org/trunk@18827 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-29 22:57:43 +00:00
Jon Cave 82c0f09c09 Fix typos in documentation (wp-includes/[i-z]). See #18560.
git-svn-id: https://develop.svn.wordpress.org/trunk@18639 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-05 19:08:15 +00:00
Peter Westwood 93fe935843 Fix typos and inconsistencies in PHPdoc / function declarations. See #17414 props duck_
git-svn-id: https://develop.svn.wordpress.org/trunk@17925 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-14 09:50:20 +00:00
Ryan Boren 4b33a0e9c4 Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@16438 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 18:47:34 +00:00
Nikolay Bachiyski 94ed154f65 Retain backwards compatiblity for the few plugins using _n_noop()
git-svn-id: https://develop.svn.wordpress.org/trunk@16075 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-29 13:37:03 +00:00
Nikolay Bachiyski 1937c1221d Introduce and use translate_nooped_plural(). Fixes #13996
* _n_noop() and _nx_noop() now return associative arrays for greater clarity
 * translate_nooped_plural() takes one such associative array and translates it
 * it works on both the result from _n_noop() and from _nx_noop()
 * this breaks backwards compatibility, but I doubt any plugin uses it (I will do a global grep to confirm)
 * translate_nooped_plural() is applied where applicable


git-svn-id: https://develop.svn.wordpress.org/trunk@16073 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-29 13:12:14 +00:00
Andrew Nacin 9494e4ce7e Phpdoc argument/@param cleanups. props duck_, see #14783.
git-svn-id: https://develop.svn.wordpress.org/trunk@15590 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-07 11:21:11 +00:00
Ryan Boren b58a019e87 Better ms lang file check. Props ocean90. fixes #13706
git-svn-id: https://develop.svn.wordpress.org/trunk@15138 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-04 12:59:44 +00:00
Ryan Boren c8db4219ea Fix ms lang file check. Props ocean90. fixes #13706
git-svn-id: https://develop.svn.wordpress.org/trunk@15137 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-04 12:53:44 +00:00
Andrew Nacin 285213f7ae Let's not emphasize that multisite might as well be its own language. fixes #13706.
git-svn-id: https://develop.svn.wordpress.org/trunk@15118 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-02 21:11:37 +00:00
Ryan Boren 0922715668 Cut 'em out, move 'em on, trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@15116 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-02 20:04:07 +00:00
Nikolay Bachiyski ea4293b291 Better detection whether we are on the Network page. Use custom constant to tell us. See #13565, props nacin
We used to load multisite translations each time WP_ALLOW_MULTISITE was defined, but
it could lead to alot of false positives. Generic config files can include to allow
users to updgrade to multisite without further editing the config file.


git-svn-id: https://develop.svn.wordpress.org/trunk@15064 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-29 20:35:19 +00:00
Nikolay Bachiyski df34727db8 Load multisite strings POT file only on multisite requests. Fixes #13565
git-svn-id: https://develop.svn.wordpress.org/trunk@15053 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-29 15:32:43 +00:00
Ryan Boren aec821c651 Strip trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@14924 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-26 02:42:15 +00:00
Andrew Nacin 47136b319f Introduce _ex(), a hybrid between _e() and _x() -- translate with context, then echo. props westi, see #13395.
git-svn-id: https://develop.svn.wordpress.org/trunk@14647 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-14 21:46:25 +00:00
Nikolay Bachiyski 53e65714a1 Cast the result of glob(), because on some systems it returns false on empty result set. Props ipstenu, fixes #13252
git-svn-id: https://develop.svn.wordpress.org/trunk@14456 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-04 21:55:34 +00:00
Nikolay Bachiyski c094caee61 Refactor get_available_languages() to use glob() instead of *dir functions. See #13023
git-svn-id: https://develop.svn.wordpress.org/trunk@14417 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-03 22:07:31 +00:00
Nikolay Bachiyski 0a0ec2ff46 Make the $path argument of load_muplugin_textdomain() functional -- relative to mu-plugins. Props uglyrobot, fixes #12875
git-svn-id: https://develop.svn.wordpress.org/trunk@14186 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-22 11:32:50 +00:00
Andrew Nacin e34ca97ae0 Change @since 3.0 to @since 3.0.0.
git-svn-id: https://develop.svn.wordpress.org/trunk@13827 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-26 19:13:36 +00:00
Ryan Boren e61755c853 Trim trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@13733 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-17 16:27:25 +00:00
Andrew Nacin 2e11ad2c3c Introduce unload_textdomain() and add plugin_locale and theme_locale filters to load_*_textdomain() functions. Fixes #9686 props nbachiyski
git-svn-id: https://develop.svn.wordpress.org/trunk@13330 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-23 11:14:35 +00:00
Andrew Nacin 65ff4db415 Introduce is_textdomain_loaded(). Fixes #10527 props nbachiyski.
git-svn-id: https://develop.svn.wordpress.org/trunk@13304 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-22 19:10:03 +00:00
Andrew Nacin 0470fb90ea Deprecate old l10n and sanitization APIs. Deprecate __ngettext() for _n(), __ngettext_noop() for _n_noop(), translate_with_context() for _x(). Deprecate sanitize_url for esc_url_raw, js_escape for esc_js, wp_specialchars for esc_html, attribute_escape for esc_attr. See #11388
git-svn-id: https://develop.svn.wordpress.org/trunk@13096 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-13 07:28:19 +00:00
Peter Westwood c45f4d2905 Ignore the continents-cities mo files when searching for the list of installed language packs. Fixes #12019
git-svn-id: https://develop.svn.wordpress.org/trunk@12988 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-06 11:42:20 +00:00
Ryan Boren 529156a002 Introduce get_available_languages(). Validate WPLANG. fixes #11774
git-svn-id: https://develop.svn.wordpress.org/trunk@12946 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-04 18:46:25 +00:00
Ryan Boren 954968abef Integrate mu_locale() into get_locale(). see #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@12900 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-29 19:03:51 +00:00
Ryan Boren 66b9e3666f Move load_muplugin_textdomain() to l10n.php
git-svn-id: https://develop.svn.wordpress.org/trunk@12840 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-26 17:25:31 +00:00
Ryan Boren 8ef8b7bad5 Trailing whitespace cleanup
git-svn-id: https://develop.svn.wordpress.org/trunk@12733 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-15 22:11:12 +00:00
Peter Westwood deb8c9097b Mark 2nd param of load_plugin_textdomain() as deprecated. Fixes #11679 props nacin.
git-svn-id: https://develop.svn.wordpress.org/trunk@12594 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-02 10:28:05 +00:00
Peter Westwood f0a6bb378b Deprecate _nc() as _nx() is a much better was of specifying contexts. Fixes #11404 props nacin.
git-svn-id: https://develop.svn.wordpress.org/trunk@12459 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-19 10:51:29 +00:00
Peter Westwood 43b9064424 Mark _c() as Deprecated people should use the new _x() instead. Fixes #11225.
git-svn-id: https://develop.svn.wordpress.org/trunk@12257 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-22 12:07:41 +00:00
Peter Westwood 6b92317f98 Allow plugins to override the behaviour of load_textdomain() in a variety of flexible ways. Fixes #11012 props johanee and nbachiyski.
git-svn-id: https://develop.svn.wordpress.org/trunk@12251 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-21 09:28:32 +00:00
Ryan Boren 42a3082c21 Add context to strings. Props nbachiyski. fixes #10738
git-svn-id: https://develop.svn.wordpress.org/trunk@12231 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-19 22:49:16 +00:00
Peter Westwood 813c76d3a2 Add load_child_theme_textdomain() to allow child themes to have there own translation files. Fixes #11033 props load_child_theme_textdomain.
git-svn-id: https://develop.svn.wordpress.org/trunk@12179 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-12 21:50:17 +00:00
Peter Westwood a9b546be54 Switch to using NOOP_Translations for untranslated sites. Fixes #10971 props nbachiyski.
git-svn-id: https://develop.svn.wordpress.org/trunk@12080 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-21 07:09:00 +00:00
Peter Westwood dcf3026244 Correct the name of the filter in _nx(). Fixes #10540 props CalebKniffen.
git-svn-id: https://develop.svn.wordpress.org/trunk@11780 602fd350-edb4-49c9-b593-d223f7449a82
2009-08-06 19:27:52 +00:00
Ryan Boren 3090ebd2b5 Update load_textdomain() phpdoc. Props nbachiyski. fixes #10286 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@11680 602fd350-edb4-49c9-b593-d223f7449a82
2009-07-01 20:05:14 +00:00
Ryan Boren f6f03210e4 Fix role translation. fixes #10270 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@11640 602fd350-edb4-49c9-b593-d223f7449a82
2009-06-25 17:18:56 +00:00
Ryan Boren 3a419fbf6d Fix load_plugin_textdomain() phpdoc. Props PotterSys. fixes #9892
git-svn-id: https://develop.svn.wordpress.org/trunk@11411 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-20 18:54:14 +00:00
Mark Jaquith f0336cfa7d deprecate wp_specialchars() in favor of esc_html(). Encode quotes for esc_html() as in esc_attr(), to improve plugin security.
git-svn-id: https://develop.svn.wordpress.org/trunk@11380 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-18 15:11:07 +00:00