Skip to content

Commit

Permalink
Published 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Whitlock committed Jan 25, 2025
1 parent fc6b176 commit 413fb5d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
6 changes: 3 additions & 3 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.7.0-dev\n"
"Project-Id-Version: Loco Translate 2.7.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/loco-translate/\n"
"POT-Creation-Date: 2025-01-25 14:22+0000\n"
"POT-Creation-Date: 2025-01-25 15:12+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.7.0-dev; wp-6.7.1\n"
"X-Loco-Version: 2.7.0; wp-6.7.1\n"
"X-Domain: loco-translate"

#. Author credit: (1) Product name (2) version number, (3) author name.
Expand Down
6 changes: 3 additions & 3 deletions loco.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Plugin URI: https://wordpress.org/plugins/loco-translate/
Description: Translate themes and plugins directly in WordPress
Author: Tim Whitlock
Version: 2.7.0-dev
Version: 2.7.0
Requires at least: 6.6
Requires PHP: 7.2.24
Tested up to: 6.7
Tested up to: 6.7.1
Author URI: https://localise.biz/wordpress/plugin
Text Domain: loco-translate
Domain Path: /languages/
Expand All @@ -31,7 +31,7 @@ function loco_plugin_file(): string {
* Get version of this plugin
*/
function loco_plugin_version(): string {
return '2.7.0-dev';
return '2.7.0';
}


Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: translation, language, multilingual, l10n, i18n
Requires at least: 6.6
Requires PHP: 7.2.24
Tested up to: 6.7.1
Stable tag: 2.6.14
Stable tag: 2.7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

= 2.7.0
* Raised minimum requirements to WordPress 6.6
* Minimum PHP version becomes 7.2.24 as per WordPress
* Minimum PHP version becomes 7.2.24 as per WordPress 6.6
* Locale-filtered bundle list now searches for base language
* Loading helper forcefully removes prematurely loaded text domains
* Machine translation hooks now have access to message context
Expand Down
4 changes: 2 additions & 2 deletions src/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public function setPluralFormsHeader( $str ){
* @param string $str original plural equation
* @return string signature for comparison
*/
private static function hashPlural( $str ){
private static function hashPlural( string $str ):string {
return trim( str_replace([' ','<>'],['','!='],$str), '()' );
}

Expand All @@ -547,7 +547,7 @@ private static function hashPlural( $str ){
* Get formality setting, whether implied or explicit.
* @return string either "", "formal" or "informal"
*/
public function getFormality(){
public function getFormality():string {
$value = '';
$tag = $this->__toString();
$variant = $this->variant;
Expand Down
7 changes: 7 additions & 0 deletions src/admin/bundle/LocaleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ public function render(){
'name' => $locale->getName(),
'attr' => 'class="'.$locale->getIcon().'" lang="'.$locale->lang.'"',
] ) );

// Sort each translation set alphabetically by bundle name...
foreach( array_keys($translations) as $type ){
usort( $translations[$type], function( ArrayAccess $a, ArrayAccess $b ):int {
return strcasecmp($a['title'],$b['title']);
} );
}

return $this->view( 'admin/bundle/locale', compact('breadcrumb','translations','types','npofiles','modified') );
}
Expand Down
7 changes: 6 additions & 1 deletion src/admin/list/LocalesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public function render(){
] );
}
}
$this->set('locales', $locales );

// Count up unique PO files
foreach( $finder->findLocaleFiles() as $file ){
Expand All @@ -101,6 +100,12 @@ public function render(){
}
}

// sort alphabetically by locale label
usort( $locales, function( ArrayAccess $a, ArrayAccess $b ):int {
return strcasecmp( $a['lname'], $b['lname'] );
} );
$this->set('locales', $locales );

return $this->view( 'admin/list/locales' );
}

Expand Down

0 comments on commit 413fb5d

Please sign in to comment.