Skip to content

Commit

Permalink
Update localization.php
Browse files Browse the repository at this point in the history
Add ary
  • Loading branch information
cyberpower678 committed Apr 24, 2024
1 parent 352373d commit 0597698
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/src/Core/localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@

class IABotLocalization {

public static function localize_ary( $timestamp, $toEN = false ) {
$locales = [
'January' => "يناير",
'February' => "فبراير",
'March' => "مارس",
'April' => "أبريل",
'May' => "ماي",
'June' => "يونيو",
'July' => "يوليوز",
'August' => "غشت",
'September' => "شتنبر",
'October' => "أكتوبر",
'November' => "نونبر",
'December' => "دجنبر"
];

if( $toEN === true ) {
$locales = array_flip( $locales );
}

foreach( $locales as $search => $replace ) {
$timestamp = str_ireplace( $search, $replace, $timestamp );
}

return $timestamp;
}

public static function localize_bn( $timestamp, $toEN = false ) {
$locales = [
'0' => "",
Expand Down

0 comments on commit 0597698

Please sign in to comment.