Skip to content

Commit

Permalink
Merge pull request #8101 from piwik/i18n-data2
Browse files Browse the repository at this point in the history
Move more i18n data translations to Intl plugin
  • Loading branch information
Stefan Giehl committed Jun 22, 2015
2 parents e4a75a3 + 310be98 commit 0dad68b
Show file tree
Hide file tree
Showing 243 changed files with 1,351 additions and 1,063 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'

### Breaking Changes
* The `UserSettings` API has been removed. The API was deprecated in earlier versions. Use `DevicesDetection`, `Resolution` and `DevicePlugins` API instead.
* Many translations have been moved to the new Intl plugin. Most of them will still work, but please update their usage. See https://github.com/piwik/piwik/pull/8101 for a full list

### New features
* The JavaScript Tracker does now track outlinks and downloads if a user opens the context menu if the `enabled` parameter of the `enableLinkTracking()` method is set to `true`. To use this new feature use `tracker.enableLinkTracking(true)` or `_paq.push(['enableLinkTracking', true]);`. This is not industry standard and is vulnerable to false positives since not every user will select "Open in a new tab" when the context menu is shown. Most users will do though and it will lead to more accurate results in most cases.
Expand Down
2 changes: 1 addition & 1 deletion core/Metrics/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentenc
} elseif ($minutes > 0) {
$return = sprintf(Piwik::translate('General_MinutesSeconds'), $minutes, $seconds);
} else {
$return = sprintf(Piwik::translate('General_Seconds'), $seconds);
$return = sprintf(Piwik::translate('Intl_NSecondsShort'), $seconds);
}

if ($isNegative) {
Expand Down
2 changes: 1 addition & 1 deletion core/Period/Week.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getLocalizedLongString()
$format = $this->translator->translate('CoreHome_LongWeekFormat');
$string = self::getTranslatedRange($format, $this->getDateStart(), $this->getDateEnd());

return $this->translator->translate('CoreHome_PeriodWeek') . " " . $string;
return $this->translator->translate('Intl_PeriodWeek') . " " . $string;
}

/**
Expand Down
16 changes: 8 additions & 8 deletions core/Plugin/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,20 @@ private static function getEnabledPeriodsNames()
$availablePeriods = self::getEnabledPeriodsInUI();
$periodNames = array(
'day' => array(
'singular' => Piwik::translate('CoreHome_PeriodDay'),
'plural' => Piwik::translate('CoreHome_PeriodDays')
'singular' => Piwik::translate('Intl_PeriodDay'),
'plural' => Piwik::translate('Intl_PeriodDays')
),
'week' => array(
'singular' => Piwik::translate('CoreHome_PeriodWeek'),
'plural' => Piwik::translate('CoreHome_PeriodWeeks')
'singular' => Piwik::translate('Intl_PeriodWeek'),
'plural' => Piwik::translate('Intl_PeriodWeeks')
),
'month' => array(
'singular' => Piwik::translate('CoreHome_PeriodMonth'),
'plural' => Piwik::translate('CoreHome_PeriodMonths')
'singular' => Piwik::translate('Intl_PeriodMonth'),
'plural' => Piwik::translate('Intl_PeriodMonths')
),
'year' => array(
'singular' => Piwik::translate('CoreHome_PeriodYear'),
'plural' => Piwik::translate('CoreHome_PeriodYears')
'singular' => Piwik::translate('Intl_PeriodYear'),
'plural' => Piwik::translate('Intl_PeriodYears')
),
// Note: plural is not used for date range
'range' => array(
Expand Down
40 changes: 12 additions & 28 deletions core/Translation/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,6 @@ class Translator
*/
private $translations = array();

/**
* Contains the already loaded country name translations
*
* @var array
*/
protected $loadedCountryTranslations = array();

/**
* Contains the already loaded continent name translations
*
* @var array
*/
protected $loadedContinentTranslations = array();

/**
* Contains the already loaded language name translations
*
* @var array
*/
private $loadedLanguageTranslations = array();

/**
* Contains the already loaded calendar translations
*
* @var array
*/
private $loadedCalendarTranslations = array();

/**
* @var string
*/
Expand Down Expand Up @@ -268,6 +240,18 @@ private function getTranslation($id, $lang, $plugin, $key)
return $this->translations[$lang][$plugin][$key];
}

/**
* Fallback for keys moved to new Intl plugin to avoid untranslated string in non core plugins
* @todo remove this in Piwik 3.0
*/
if ($plugin != 'Intl') {
if (isset($this->translations[$lang]['Intl'])
&& isset($this->translations[$lang]['Intl'][$key])
) {
return $this->translations[$lang]['Intl'][$key];
}
}

// fallback
if ($lang !== $this->fallback) {
return $this->getTranslation($id, $this->fallback, $plugin, $key);
Expand Down
2 changes: 1 addition & 1 deletion core/Visualization/Sparkline.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function main()

$min = $max = $last = null;
$i = 0;
$seconds = Piwik::translate('General_Seconds');
$seconds = Piwik::translate('Intl_NSecondsShort');
$toRemove = array('%', str_replace('%s', '', $seconds));

foreach ($this->values as $value) {
Expand Down
5 changes: 1 addition & 4 deletions lang/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"HelloUser": "ሃሎ, %s!",
"Id": "የለም",
"JsTrackingTag": "የጃቫ ስክሪፕት ዱካ መከተያ መለያ",
"LayoutDirection": "ltr",
"Loading": "በማስገባት ላይ...",
"LoadingData": "ውሂብ በማስገባት ላይ...",
"Locale": "am_ET.UTF-8",
Expand Down Expand Up @@ -62,7 +61,6 @@
"Settings": "ቅንብሮች",
"Table": "ሰንጠረዥ",
"TagCloud": "መለያ Cloud",
"Today": "ዛሬ",
"TranslatorEmail": "info@addismap.com",
"TranslatorName": "Alazar Tekle of <a href=\"http:\/\/www.addismap.com\">Addis Map<\/a> \/ <a href=\"http:\/\/www.map.et\">Ethiopia Map<\/a>",
"Unknown": "ያልታወቀ",
Expand All @@ -73,7 +71,6 @@
"Warning": "ማስጠንቀቂያ",
"Website": "ድር ጣቢያ",
"Widgets": "Widgets",
"Yes": "አዎን",
"Yesterday": "ትናንት"
"Yes": "አዎን"
}
}
6 changes: 0 additions & 6 deletions lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"JsTrackingTag": "وسم التتبع بلغة جافا",
"Language": "اللغة",
"LastDays": "آخر %s أيام (تشمل اليوم)",
"LayoutDirection": "rtl",
"Loading": "جاري التحميل...",
"LoadingData": "جاري تحميل البيانات...",
"Locale": "ar_EG.UTF-8",
Expand All @@ -150,11 +149,9 @@
"NoDataForTagCloud": "لا توجد بيانات لسحابة الوسوم هذه.",
"NotDefined": "ليست محددة %s",
"NotValid": "%s غير صالح",
"NSeconds": "%s ثانية",
"NumberOfVisits": "عدد الزيارات",
"NVisits": "%s الزيارات",
"Ok": "موافق",
"OneDay": "يوم",
"OneVisit": "1 زيارة",
"OnlyEnterIfRequired": "أدخل اسم مستخدم فقط في حالة ما إذا كان مزود SMTP يطلب ذلك.",
"OnlyEnterIfRequiredPassword": "أدخل كلمة مرور فقط في حالة ما إذا كان مزود SMTP يطلب ذلك.",
Expand Down Expand Up @@ -203,7 +200,6 @@
"Save": "حفظ",
"SaveImageOnYourComputer": "لحفظ الصورة على جهازك، انقر بز الفأرة الأيمن واختر \"حفظ الصورة باسم\"...",
"Search": "بحث",
"Seconds": "%s ثانية",
"SeeTheOfficialDocumentationForMoreInformation": "انظر %sمستندات المساعدة الرسمية%s لمزيد من المعلومات.",
"SelectYesIfYouWantToSendEmailsViaServer": "اختر \"نعم\" إذا كنت ترغب في أو يتوجب عليك إرسال البريد الإلكتروني من خلال مزود معين بدلاً من دالة البريد الإلكتروني المحلية.",
"Settings": "الإعدادات",
Expand All @@ -217,7 +213,6 @@
"Summary": "موجز",
"Table": "جدول",
"TagCloud": "سحابة وسوم",
"Today": "اليوم",
"Total": "مجموع",
"TotalRevenue": "إجمالي الإيرادات",
"TranslatorEmail": "mustafa@i-translate.info, benkheil.abdelouali@gmail.com",
Expand Down Expand Up @@ -248,7 +243,6 @@
"Widgets": "الإضافات",
"YearsDays": "%1$s سنة %2$s أيام",
"Yes": "نعم",
"Yesterday": "الأمس",
"YouAreViewingDemoShortMessage": "أنت تشاهد حالياً نسخة عرض من Piwik",
"YouMustBeLoggedIn": "يجب عليك تسجيل الدخول للوصول إلى هذه الخاصية.",
"YourChangesHaveBeenSaved": "تم حفظ التغييرات."
Expand Down
7 changes: 0 additions & 7 deletions lang/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
"JsTrackingTag": "Код JavaScript",
"Language": "Мова",
"LastDays": "Апошніх %s дзён (уключаючы сёння)",
"LayoutDirection": "ltr",
"Loading": "Загрузка…",
"LoadingData": "Загрузка дадзеных…",
"Locale": "be_BY.UTF-8",
Expand All @@ -162,7 +161,6 @@
"MultiSitesSummary": "Усе вэб-сайты",
"Name": "Імя",
"NbActions": "Колькасць дзеянняў",
"NDays": "%s дзён",
"Never": "Ніколі",
"NewReportsWillBeProcessedByCron": "Калі архіваванне Piwik не запускаецца ў браўзэры, новыя справаздачы будуць апрацаваныя кронтабам.",
"NewUpdatePiwikX": "Новае абнаўленне: Piwik %s",
Expand All @@ -174,11 +172,9 @@
"NoDataForTagCloud": "Няма дадзеных для гэтага аблока тэгаў.",
"NotDefined": "%s не вызначана",
"NotValid": "%s не сапраўдны",
"NSeconds": "%s секунд",
"NumberOfVisits": "Колькасць наведванняў",
"NVisits": "%s наведванняў",
"Ok": "Ок",
"OneDay": "1 дзень",
"OneVisit": "1 наведванне",
"OnlyEnterIfRequired": "Увядзіце імя карыстальніка толькі, калі ваш SMTP-сервер патрабуе гэтага.",
"OnlyEnterIfRequiredPassword": "Увядзіце пароль толькі, калі ваш SMTP-сервер патрабуе гэтага.",
Expand Down Expand Up @@ -219,7 +215,6 @@
"Save": "Захаваць",
"SaveImageOnYourComputer": "Каб захаваць малюнак на ваш кампутар, націсніце правай кнопкай мышы на малюнак і абярыце \"Захаваць малюнак як…\"",
"Search": "Пошук",
"Seconds": "%sс",
"SeeTheOfficialDocumentationForMoreInformation": "Глядзіце %sафіцыйную дакументацыю%s для атрымання падрабязнай інфармацыі.",
"SelectYesIfYouWantToSendEmailsViaServer": "Адзначце \"Так\" калі патрэбна адправіць электронную пошту праз імянны сервер, замест выкарысання лакальнай паштовай функціі",
"Settings": "Наладкі",
Expand All @@ -234,7 +229,6 @@
"Table": "Табліца",
"TagCloud": "Воблака тэгаў",
"Tax": "Падатак",
"Today": "Сёння",
"Total": "Агульна",
"TotalRevenue": "Агульны прыбытак",
"TranslatorEmail": "by.marcis@gmail.com, albanardua@gmail.com, iflexion.1@gmail.com",
Expand Down Expand Up @@ -270,7 +264,6 @@
"Widgets": "Віджэты",
"YearsDays": "%1$s гадоў %2$s дзён",
"Yes": "Так",
"Yesterday": "Учора",
"YouAreViewingDemoShortMessage": "Вы праглядаеце дэма версію Piwik",
"YouMustBeLoggedIn": "Каб атрымаць доступ да гэтай функцыянальнасці, Вы павінны аўтарызавацца.",
"YourChangesHaveBeenSaved": "Вашы змены былі захаваныя."
Expand Down
10 changes: 0 additions & 10 deletions lang/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
"Language": "Език",
"LastDays": "Последните %s дни (с днес)",
"LastDaysShort": "Последните %s дни",
"LayoutDirection": "ltr",
"LearnMore": "%1$sнаучете повече%2$s",
"Live": "На живо",
"Loading": "Зарежда...",
Expand Down Expand Up @@ -219,29 +218,24 @@
"Name": "Име",
"NbActions": "Брой действията",
"NbSearches": "Брой вътрешни търсения",
"NDays": "%s дни",
"Never": "Никога",
"NewReportsWillBeProcessedByCron": "Когато Piwik архивирането не е предизвикано от браузърът, новите доклади ще бъдат обработени от crontab.",
"NewUpdatePiwikX": "Нова версия: Piwik %s",
"NewVisitor": "Нов посетител",
"NewVisits": "Нови посещения",
"Next": "Напред",
"NMinutes": "%s минути",
"No": "Не",
"NoDataForGraph": "Няма информация за тази графика.",
"NoDataForTagCloud": "Няма данни за този таг облак.",
"NotDefined": "%s недефинирани",
"Note": "Бележка",
"NotInstalled": "Не е иснталиран",
"NotValid": "%s не е валиден",
"NSeconds": "%s секунди",
"NumberOfVisits": "Брой посетители",
"NUsers": "%s потребители",
"NVisits": "%s посещения",
"Ok": "Ок",
"OneAction": "1 действие",
"OneDay": "1 ден",
"OneMinute": "1 минута",
"OneVisit": "1 посещение",
"OnlyEnterIfRequired": "Въведете само потребителя ако Вашият SMTP сървър го изисква",
"OnlyEnterIfRequiredPassword": "Въведете само паролата ако Вашият SMTP сървър го изисква",
Expand Down Expand Up @@ -312,7 +306,6 @@
"Search": "Търсене",
"Clear": "Изчисти",
"SearchNoResults": "Няма резултати",
"Seconds": "%sс",
"SeeAll": "вижте всички",
"SeeTheOfficialDocumentationForMoreInformation": "Прегледайте %sofficial documentation%s за повече информация",
"SeeThisFaq": "Вижте %1$sтези често задавани въпроси%2$s.",
Expand All @@ -336,7 +329,6 @@
"Tax": "Данък",
"TimeAgo": "%s преди",
"TimeOnPage": "Време на страница",
"Today": "Днес",
"Total": "Общо",
"TotalRatioTooltip": "Това е %1$s от всички %2$s %3$s.",
"TotalRevenue": "Общо приход",
Expand Down Expand Up @@ -386,9 +378,7 @@
"YearlyReport": "годишно",
"YearlyReports": "Годишни доклади",
"YearsDays": "%1$s години %2$s дни",
"YearShort": "г.",
"Yes": "Да",
"Yesterday": "Вчера",
"YouAreCurrentlyUsing": "Вие използвате Piwik %s.",
"YouAreViewingDemoShortMessage": "В момента Вие разглеждате демо версия на Piwik",
"YouMustBeLoggedIn": "Трябва да сте влязъл, за да имате достъп до тази функционалност.",
Expand Down
5 changes: 1 addition & 4 deletions lang/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"Help": "সাহায্য",
"Id": "হিন্দি",
"Language": "ভাষা",
"LayoutDirection": "ltr",
"Loading": "লোড করা হচ্ছে...",
"LoadingData": "ডাটা লোড করা হচ্ছে...",
"Locale": "bn_BD.UTF-8",
Expand All @@ -52,15 +51,13 @@
"SmtpServerAddress": "SMTP সার্ভারের ঠিকানা",
"SmtpUsername": "SMTP ব্যবহারকারীর নাম",
"Table": "সারণি",
"Today": "আজ",
"Total": "সর্বমোট",
"TranslatorEmail": "-",
"TranslatorName": "Anjan Dutta, Rezaul Hasan",
"Upload": "আপলোড",
"Username": "ব্যবহারকারীর নাম",
"Warning": "সতর্কতা",
"Website": "ওয়েবসাইট",
"Weekly": "সাপ্তাহিক",
"Yesterday": "গতকাল"
"Weekly": "সাপ্তাহিক"
}
}
8 changes: 0 additions & 8 deletions lang/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
"Language": "Jezik",
"LastDays": "Posljednji %s dani (uključujući danas)",
"LastDaysShort": "Posljednji %s dani",
"LayoutDirection": "ltr",
"Live": "Uživo",
"Loading": "Učitavanje...",
"LoadingData": "Učitavanje informacija...",
Expand All @@ -178,7 +177,6 @@
"MultiSitesSummary": "Sve web stranice",
"Name": "Ime",
"NbActions": "Broj akcija",
"NDays": "%s dani",
"Never": "Nikad",
"NewReportsWillBeProcessedByCron": "Ako Piwik arhiviranje nije pokrenuto od browsera, novi reporti ce biti procesirani od strane crontab-a.",
"NewUpdatePiwikX": "Novi update: Piwik %s",
Expand All @@ -190,13 +188,10 @@
"NoDataForTagCloud": "Nema podataka za ovaj oblak sa etiketama.",
"NotDefined": "%s nije definiran",
"NotValid": "%s nije važeći",
"NSeconds": "%s sekundi.",
"NumberOfVisits": "Broj posjeta",
"NVisits": "%s posjete",
"Ok": "Ok",
"OneAction": "1 akcija",
"OneDay": "1 dan",
"OneMinute": "1 minuta",
"OneVisit": "1 posjeta",
"OnlyEnterIfRequired": "Samo upišite korisničko ime ako vaš SMTP server to zahtijeva.",
"OnlyEnterIfRequiredPassword": "SaSamo upišite password ako vaš SMTP server to zahtijeva.",
Expand Down Expand Up @@ -257,7 +252,6 @@
"Save": "Sačuvaj",
"SaveImageOnYourComputer": "Da sačuvaš sliku na računar, klikni desni klik na sliku i klikni \"Save Image As...\"",
"Search": "Traži",
"Seconds": "%ss",
"SeeAll": "pogledaj sve",
"SeeTheOfficialDocumentationForMoreInformation": "Vidi the %sofficial documentation%s za više informacija.",
"SelectYesIfYouWantToSendEmailsViaServer": "Izaberite \"Da\" ako želite da pošaljete e-mail preko servera umjesto lokalne mail funkcije.",
Expand All @@ -277,7 +271,6 @@
"TagCloud": "Oblak sa etiketama",
"Tax": "Taksa",
"TimeOnPage": "Vrijeme na stranici",
"Today": "Danas",
"Total": "Ukupno",
"TotalRevenue": "Ukupna zarada",
"TranslatorEmail": "translations@piwik.org",
Expand Down Expand Up @@ -317,7 +310,6 @@
"YearlyReports": "Godišnji reporti",
"YearsDays": "%1$s godine %2$s dani",
"Yes": "Da",
"Yesterday": "Jučer",
"YouAreCurrentlyUsing": "Trenutno koristite piwik %s.",
"YouAreViewingDemoShortMessage": "Trenutno pregledate demo veziju Piwik-a",
"YouMustBeLoggedIn": "Moras biti ulogovan za ovu funkciju.",
Expand Down
Loading

0 comments on commit 0dad68b

Please sign in to comment.