Skip to content

Commit

Permalink
Merge pull request #966 from joomla/l10n_crowdin_package_v4
Browse files Browse the repository at this point in the history
New Crowdin translations by GitHub Action
  • Loading branch information
tecpromotion authored Jan 16, 2024
2 parents 891f215 + 5f2b250 commit 5fe2c01
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions joomla_v4/translations/package/be-BY/language/be-BY/localise.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?php
/**
* @package Joomla.Language
*
* @copyright (C) 2005 - 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
* @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
*/

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* be-BY localise class.
*
* @since 1.6
*/
abstract class Be_BYLocalise
{
/**
* Returns the potential suffixes for a specific number of items
*
* @param integer $count The number of items
*
* @return array An array of potential suffixes
*
* @since 1.6
*/
public static function getPluralSuffixes($count)
{
if ($count == 0)
{
$return = ['0'];

} else {
$return = [($count%10==1 && $count%100!=11 ? '1' : ($count%10>=2 && $count%10<=4 && ($count%100<10 || $count%100>=20)? '2' : 'MORE'))];

}

return $return;
}

public static function transliterate($string)
{
$str = StringHelper::strtolower($string);

$glyph_array = [
'a' => 'а',
'b' => 'б',
'v' => 'в',
'g' => 'г,ґ',
'd' => 'д',
'e' => 'е,є,э',
'jo' => 'ё',
'zh' => 'ж',
'z' => 'з',
'i' => 'и,і',
'ji' => 'ї',
'j' => 'й',
'k' => 'к',
'l' => 'л',
'm' => 'м',
'n' => 'н',
'o' => 'о',
'p' => 'п',
'r' => 'р',
's' => 'с',
't' => 'т',
'u' => 'у,ў',
'f' => 'ф',
'kh' => 'х',
'ts' => 'ц',
'ch' => 'ч',
'sh' => 'ш',
'shch' => 'щ',
'' => 'ъ',
'y' => 'ы',
'' => 'ь',
'yu' => 'ю',
'ya' => 'я',
];


foreach ($glyph_array as $letter => $glyphs)
{
$glyphs = explode(',', $glyphs);
$str = StringHelper::str_ireplace($glyphs, $letter, $str);
}

$str = preg_replace('#\&\#?[a-z0-9]+\;#ismu', '', $str);

return $str;
}
}

0 comments on commit 5fe2c01

Please sign in to comment.