Skip to content

Commit

Permalink
Published 2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Whitlock committed Oct 25, 2022
1 parent 8b7f128 commit 899a2de
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
26 changes: 13 additions & 13 deletions languages/loco-translate.pot
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Loco Translate 2.6.3-dev\n"
"Project-Id-Version: Loco Translate 2.6.3\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/loco-translate/\n"
"POT-Creation-Date: 2022-10-25 17:48+0000\n"
"POT-Creation-Date: 2022-10-25 19:47+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
Expand All @@ -13,7 +13,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.6.3-dev; wp-6.0.3\n"
"X-Loco-Version: 2.6.3; wp-6.0.3\n"
"X-Domain: loco-translate"

#: src/fs/FileWriter.php:214
Expand Down Expand Up @@ -632,7 +632,7 @@ msgid "Download"
msgstr ""

#. Label for the plural form of the original English text
#: src/Locale.php:404 src/js/Strings.php:143
#: src/Locale.php:402 src/js/Strings.php:143
msgctxt "Editor"
msgid "Plural"
msgstr ""
Expand All @@ -656,7 +656,7 @@ msgid "Save"
msgstr ""

#. Label for the singular form of the original English text
#: src/Locale.php:403 src/js/Strings.php:140
#: src/Locale.php:401 src/js/Strings.php:140
msgctxt "Editor"
msgid "Single"
msgstr ""
Expand Down Expand Up @@ -1045,7 +1045,7 @@ msgstr ""
msgid "Installed languages"
msgstr ""

#: src/Locale.php:330
#: src/Locale.php:329
msgid "Invalid locale"
msgstr ""

Expand Down Expand Up @@ -1406,43 +1406,43 @@ msgid "Plugins"
msgstr ""

#. Plural category used in some multi-plural languages
#: src/Locale.php:418
#: src/Locale.php:416
msgctxt "Plural category"
msgid "Few"
msgstr ""

#. Plural category used in some multi-plural languages
#: src/Locale.php:420
#: src/Locale.php:418
msgctxt "Plural category"
msgid "Many"
msgstr ""

#. Plural category for singular quantity
#: src/Locale.php:414
#: src/Locale.php:412
msgctxt "Plural category"
msgid "One"
msgstr ""

#. General plural category not covered by other forms
#: src/Locale.php:422
#: src/Locale.php:420
msgctxt "Plural category"
msgid "Other"
msgstr ""

#. Plural category used in some multi-plural languages
#: src/Locale.php:416
#: src/Locale.php:414
msgctxt "Plural category"
msgid "Two"
msgstr ""

#. Plural category for zero quantity
#: src/Locale.php:412
#: src/Locale.php:410
msgctxt "Plural category"
msgid "Zero"
msgstr ""

#. Shown when a PO file's Plural-Forms header has a different formula from the Unicode CLDR rules
#: src/Locale.php:527
#: src/Locale.php:528
msgid ""
"Plural forms differ from Loco Translate's built in rules for this language"
msgstr ""
Expand Down
4 changes: 2 additions & 2 deletions loco.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://wordpress.org/plugins/loco-translate/
Description: Translate themes and plugins directly in WordPress
Author: Tim Whitlock
Version: 2.6.3-dev
Version: 2.6.3
Requires at least: 5.2
Requires PHP: 5.6.20
Tested up to: 6.0.3
Expand Down Expand Up @@ -33,7 +33,7 @@ function loco_plugin_file(){
* @return string
*/
function loco_plugin_version(){
return '2.6.3-dev';
return '2.6.3';
}


Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: translation, translators, localization, localisation, l10n, i18n, Gettext,
Requires at least: 5.2
Requires PHP: 5.6.20
Tested up to: 6.0.3
Stable tag: 2.6.2
Stable tag: 2.6.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -101,6 +101,7 @@ We don't collect your data or snoop on you. See the [plugin privacy notice](http
== Changelog ==

= 2.6.3 =
* Fixed bug in plural forms comparison
* Fixed bug generating author theme jsons
* Fixed errors in bundle debugger
* Extended cli type argument to filter specific bundle
Expand Down
37 changes: 19 additions & 18 deletions src/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Loco_Locale implements JsonSerializable {
private $valid;

/**
* @param string
* @param string $tag
* @return Loco_Locale
*/
public static function parse( $tag ){
Expand All @@ -77,9 +77,9 @@ public static function parse( $tag ){
/**
* Construct from subtags NOT from composite tag. See self::parse
* Note that this skips normalization and validation steps
* @param string
* @param string
* @param string
* @param string $lang
* @param string $region
* @param string $variant
*/
public function __construct( $lang = '', $region = '', $variant = '' ){
if( 1 == func_num_args() && isset($lang[3]) ){
Expand All @@ -92,7 +92,7 @@ public function __construct( $lang = '', $region = '', $variant = '' ){
/**
* Allow read access to subtags
* @internal
* @param string
* @param string $t subtag
* @return string
*/
public function __get( $t ){
Expand All @@ -103,8 +103,8 @@ public function __get( $t ){
/**
* Allow write access to subtags
* @internal
* @param string
* @param string
* @param string $t subtag, e.g. "lang"
* @param string $s subtag value, e.g. "en"
* @return void
*/
public function __set( $t, $s ){
Expand All @@ -117,7 +117,7 @@ public function __set( $t, $s ){

/**
* Set subtags as produced from loco_parse_wp_locale
* @param string[]
* @param string[] $tag
* @return Loco_Locale
*/
public function setSubtags( array $tag ){
Expand Down Expand Up @@ -185,7 +185,7 @@ public function __toString(){


/**
* @param bool whether to get name in current display language
* @param bool $translate whether to get name in current display language
* @return string | null
*/
public function getName( $translate = true ){
Expand Down Expand Up @@ -245,7 +245,7 @@ public function getIcon(){


/**
* @param string CSS icon name
* @param string $css CSS icon name
* @return Loco_Locale
*/
public function setIcon( $css ){
Expand All @@ -260,8 +260,8 @@ public function setIcon( $css ){


/**
* @param string
* @param string
* @param string $english_name
* @param string $native_name
* @return Loco_Locale
*/
public function setName( $english_name, $native_name = '' ){
Expand All @@ -285,7 +285,6 @@ public function isValid(){

/**
* Resolve this locale's "official" name from WordPress's translation api
* @param Loco_api_WordPressTranslations
* @return string English name currently set
*/
public function fetchName( Loco_api_WordPressTranslations $api ){
Expand Down Expand Up @@ -335,7 +334,6 @@ public function buildName(){

/**
* Ensure locale has a label, even if it has to fall back to language code or error
* @param Loco_api_WordPressTranslations
* @return string
*/
public function ensureName( Loco_api_WordPressTranslations $api ){
Expand Down Expand Up @@ -470,7 +468,7 @@ public function getPluralFormsHeader(){

/**
* Apply PO style Plural-Forms header.
* @param string e.g. "nplurals=2; plural=n != 1;"
* @param string $str header value e.g. "nplurals=2; plural=n != 1;"
* @return void
*/
public function setPluralFormsHeader( $str ){
Expand Down Expand Up @@ -514,8 +512,11 @@ public function setPluralFormsHeader( $str ){
}
$keys[] = implode(',',$sample).$suffix;
}
// use mnemonic tag only if it matches the default (CLDR) tag for the current language
if( array_keys($this->plurals) !== $keys ) {
// cast to string for comparison due to PHP forcing integer keys in this->plurals
$expect = implode('|',$keys);
$actual = implode('|',array_keys($this->plurals));
// use mnemonic tags only if they match the default (CLDR) tags for the current language
if( $expect !== $actual ){
// exception when two forms only and the first accepts n=1 and second n=2
if( 2 === $nplurals && 0 === $formula->execute(1) && 1 === $formula->execute(2) ){
$tags = ['one','other'];
Expand All @@ -534,7 +535,7 @@ public function setPluralFormsHeader( $str ){

/**
* Crude normalizer for a plural equation such that similar formulae can be compared.
* @param string original plural equation
* @param string $str original plural equation
* @return string signature for comparison
*/
private static function hashPlural( $str ){
Expand Down

0 comments on commit 899a2de

Please sign in to comment.