Commit Graph

23 Commits

Author SHA1 Message Date
John Blackbourn 280aabee27 I18N: Avoid translating `wp_locale` strings several times.
This avoids 26 unnecessary duplicate translations.

Props Chouby

Fixes #54564

Built from https://develop.svn.wordpress.org/trunk@52956


git-svn-id: http://core.svn.wordpress.org/trunk@52545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 21:18:03 +00:00
audrasjb 837cb1e93b Docs: Use third-person singular verbs for function descriptions in `wp-includes/class-wp-locale.php`.
Follow-up to [52929].

See #54729.

Built from https://develop.svn.wordpress.org/trunk@52930


git-svn-id: http://core.svn.wordpress.org/trunk@52519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:06:01 +00:00
audrasjb 30a77d5fa4 i18n: Define List item separator as a WP_Locale property.
The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:

- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes

Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes #39733.

Built from https://develop.svn.wordpress.org/trunk@52929


git-svn-id: http://core.svn.wordpress.org/trunk@52518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 20:03:01 +00:00
John Blackbourn ecc08a41f6 Docs: Increase the specificity of types in various inline documentation.
See #54729

Built from https://develop.svn.wordpress.org/trunk@52652


git-svn-id: http://core.svn.wordpress.org/trunk@52241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:25:03 +00:00
Sergey Biryukov ef5a994a3c Docs: Fix typos in some DocBlocks.
Props kebbet.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52597


git-svn-id: http://core.svn.wordpress.org/trunk@52185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 20:29:06 +00:00
Sergey Biryukov d5b8d282e8 Docs: Update the URL for PHP date formats table in translator comments.
Props hareesh-pillai, iandunn.
Fixes #51332.
Built from https://develop.svn.wordpress.org/trunk@48991


git-svn-id: http://core.svn.wordpress.org/trunk@48753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 10:37:08 +00:00
Sergey Biryukov 7932193708 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47808


git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-16 18:42:12 +00:00
Sergey Biryukov 32edd58e4c Docs: Add descriptions for some globals:
* `$wp_version`
* `$wp_local_package`
* `$required_php_version`
* `$required_mysql_version`

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47230


git-svn-id: http://core.svn.wordpress.org/trunk@47030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-10 03:30:06 +00:00
Sergey Biryukov 001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov 2900bb8ea7 Docs: Update links to https://secure.php.net/, they now redirect to https://www.php.net/.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@47088


git-svn-id: http://core.svn.wordpress.org/trunk@46888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-20 03:14:06 +00:00
Sergey Biryukov eb3f420848 Code Modernization: Remove all code using a `version_compare()` with a PHP version older than PHP 5.6.
Props jrf.
Fixes #48074.
Built from https://develop.svn.wordpress.org/trunk@46214


git-svn-id: http://core.svn.wordpress.org/trunk@46026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-20 22:02:57 +00:00
Sergey Biryukov e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Dominik Schilling 892a80d974 I18N: Use RTL stylesheets when running from /src.
To run WordPress from /src you have to use the `--dev` flag which also builds the RTL stylesheets thus the admin notice and force to LTR is no longer required.

See #44492.
Fixes #44865.
Built from https://develop.svn.wordpress.org/trunk@45688


git-svn-id: http://core.svn.wordpress.org/trunk@45499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-27 14:17:57 +00:00
Sergey Biryukov 577dc2326a Bootstrap/Load: Restore `$wp_version` global check in `WP_Locale::init()`, previously replaced with `get_bloginfo( 'version' )` in [38459].
`wp_load_translations_early()` can be called in contexts where `get_bloginfo()` is not available yet, e.g. in `wp_check_php_mysql_versions()`.

Props shazdeh, parsmizban.
Fixes #41092.
Built from https://develop.svn.wordpress.org/trunk@45029


git-svn-id: http://core.svn.wordpress.org/trunk@44838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 13:27:52 +00:00
Gary Pendergast 4f861b9548 Coding Standards: Fix the `Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace` violations.
See #45934.


Built from https://develop.svn.wordpress.org/trunk@44566


git-svn-id: http://core.svn.wordpress.org/trunk@44397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:40:50 +00:00
Dominik Schilling 5eddf9a359 I18N: Remove unused `$start_of_week` property from `WP_Locale`.
Missed in [35685], see #28344.

Props birgire, tonybogdanov.
Fixes #43344.
Built from https://develop.svn.wordpress.org/trunk@42718


git-svn-id: http://core.svn.wordpress.org/trunk@42546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-18 16:32:34 +00:00
Sergey Biryukov 4048a63b01 Docs: Add missing description for `$weekday_name` parameter and `@return` entry in `WP_Locale::get_weekday_initial()`.
Props keesiemeijer, 1naveengiri.
Fixes #42793.
Built from https://develop.svn.wordpress.org/trunk@42361


git-svn-id: http://core.svn.wordpress.org/trunk@42190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-04 15:59:54 +00:00
Gary Pendergast aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Drew Jaynes 0860bb2771 Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.

Built from https://develop.svn.wordpress.org/trunk@41162


git-svn-id: http://core.svn.wordpress.org/trunk@41002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:41:44 +00:00
Sergey Biryukov 008c1f7e60 Docs: Correct `@access` entries for `WP_Locale::init()` and `WP_Locale::register_globals()`.
Props keesiemeijer.
Fixes #39504.
Built from https://develop.svn.wordpress.org/trunk@39737


git-svn-id: http://core.svn.wordpress.org/trunk@39677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:11:16 +00:00
Scott Taylor 9383bf8f74 General: use `get_bloginfo( 'version' )` instead of `global $wp_version` in several locations - excluding those locations which reload `version.php` mid-flight.
See #37699.

Built from https://develop.svn.wordpress.org/trunk@38459


git-svn-id: http://core.svn.wordpress.org/trunk@38400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 05:49:37 +00:00
Scott Taylor d3312bc278 Locale: declare the `$month_genitive` field on `WP_Locale`.
See #37771.

Built from https://develop.svn.wordpress.org/trunk@38316


git-svn-id: http://core.svn.wordpress.org/trunk@38257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-22 21:33:28 +00:00
Dominik Schilling aeb8d2fbad I18N: Move the `WP_Locale` class to its own file.
The new `class-wp-locale.php` file is loaded in `locale.php` for backward compatibility purposes.

See #26511.
Fixes #37209.
Built from https://develop.svn.wordpress.org/trunk@37889


git-svn-id: http://core.svn.wordpress.org/trunk@37830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 11:53:28 +00:00