Skip to content

Commit

Permalink
Merge pull request #91 from kabir-afk/master
Browse files Browse the repository at this point in the history
Minimal `browser.i18n` API test
  • Loading branch information
hugolpz authored Jun 10, 2024
2 parents 7729d0b + 6bc7b91 commit 90c0828
Show file tree
Hide file tree
Showing 84 changed files with 118 additions and 115 deletions.
16 changes: 9 additions & 7 deletions SignItCoreContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@ var SignItCoreContent = function (locale,mapi18n) {
banana = { i18n: (msg) => sourceMap.get(locale)[msg] };
console.log("Passed trough ! :", locale);
console.log("SignItCoreContent.js",banana );
// let hlwa = browser.i18n.getMessage("si-panel-videos-title");
// console.log("hlwa = ",hlwa);
this.$container = $(`
<div class="signit-modal-container">
<h1></h1>
<div class="signit-modal-content">
<div class="signit-panel-videos">
<div class="signit-panel-videos signit-novideo">
<h2>
${ banana.i18n("si-panel-videos-title") }</h2>
${ banana.i18n("si-panel-videos-empty") }<br><br>
${ browser.i18n.getMessage("si_panel_videos_title") }</h2>
${ browser.i18n.getMessage("si_panel_videos_empty") }<br><br>
</div>
<div class="signit-panel-videos signit-video"></div>
</div>
<div class="signit-panel-separator"></div>
<div class="signit-panel-definitions">
<div class="signit-panel-definitions signit-definitions">
<h2>
${ banana.i18n("si-panel-definitions-title") }</h2>
${ browser.i18n.getMessage("si_panel_definitions_title") }</h2>
<div class="signit-definitions-text"></div>
<div class="signit-definitions-source">
<a href="https://${ banana.i18n("si-panel-definitions-wikt-iso") }.wiktionary.org">
${ banana.i18n("si-panel-definitions-wikt-pointer") }</a>
<a href="https://${ browser.i18n.getMessage("si_panel_definitions_wikt_iso") }.wiktionary.org">
${ browser.i18n.getMessage("si_panel_definitions_wikt_pointer") }</a>
</div>
</div>
<div class="signit-panel-definitions signit-loading">
Expand All @@ -32,7 +34,7 @@ var SignItCoreContent = function (locale,mapi18n) {
)}" width="40" height="40">
</div>
<div class="signit-panel-definitions signit-error">
${ banana.i18n("si-panel-definitions-empty") }</div>
${ browser.i18n.getMessage("si_panel_definitions_empty") }</div>
</div>
</div>
</div>
Expand All @@ -41,7 +43,7 @@ var SignItCoreContent = function (locale,mapi18n) {
// Button contribute
var optionsContribute = {
flags: ["primary", "progressive"],
label: banana.i18n("si-panel-videos-contribute-label") ,
label: browser.i18n.getMessage("si_panel_videos_contribute_label") ,
href: "https://lingualibre.org/wiki/Special:RecordWizard",
};
this.contributeButton = new OO.ui.ButtonWidget(optionsContribute);
Expand Down
2 changes: 1 addition & 1 deletion SignItVideosGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SignItVideosGallery.prototype.refresh = async function ( files ) {
this.$videos.push( $( `
<div style="display: none;">
<video controls="" muted="" preload="auto" src="${ files[ i ].filename }" width="250" class=""></video>
${banana.i18n("si-panel-videos-gallery-attribution", url, speaker, i+1, total)}
${browser.i18n.getMessage("si_panel_videos_gallery_attribution",[ url, speaker, i+1, total])}
</div>
` ) );

Expand Down
2 changes: 1 addition & 1 deletion _locales/anp/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a> द्वारा – $4 मँ सँ $3 नंबरिया वीडियो",
"message": "<a href='$1' target='_blank'>$2</a> द्वारा – $4 मँ सँ $3 नंबरिया वीडियो",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/az/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a> – Video $3/$4",
"message": "<a href='$1' target='_blank'>$2</a> – Video $3/$4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/blk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a>တွမ်ႏ – ဗီဒီယို $3 ယို $4",
"message": "<a href='$1' target='_blank'>$2</a>တွမ်ႏ – ဗီဒီယို $3 ယို $4",
"description": ""
},
"si_panel_videos_contribute_label": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/bn/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a> দ্বারা – $4 এর মধ্যে $3 নং ভিডিও",
"message": "<a href='$1' target='_blank'>$2</a> দ্বারা – $4 এর মধ্যে $3 নং ভিডিও",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/br/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "gant <a href='$1'>$2</a> – $3 eus $4 video",
"message": "gant <a href='$1' target='_blank'>$2</a> – $3 eus $4 video",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/ce/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "авторалла: <a href='$1'>$2</a> – $3 видео $4 чохь",
"message": "авторалла: <a href='$1' target='_blank'>$2</a> – $3 видео $4 чохь",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "von <a href='$1'>$2</a> – Video $3 von $4",
"message": "von <a href='$1' target='_blank'>$2</a> – Video $3 von $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/diq/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "Be <a href='$1'>$2</a> ra – Video $3 yê $4",
"message": "Be <a href='$1' target='_blank'>$2</a> ra – Video $3 yê $4",
"description": ""
},
"si_panel_definitions_title": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "by <a href='$1'>$2</a> – Video $3 of $4",
"message": "by <a href='$1' target='_blank'>$2</a> – Video $3 of $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "por <a href='$1'>$2</a> – Video $3 de $4",
"message": "por <a href='$1' target='_blank'>$2</a> – Video $3 de $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/fa/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "توسط <a href='$1'>$2</a> – ویدئو $3 از میان $4",
"message": "توسط <a href='$1' target='_blank'>$2</a> – ویدئو $3 از میان $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/fi/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "tekijä: <a href='$1'>$2</a> – Video $3 / $4",
"message": "tekijä: <a href='$1' target='_blank'>$2</a> – Video $3 / $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "par <a href='$1'>$2</a> – Vidéo $3 sur $4",
"message": "par <a href='$1' target='_blank'>$2</a> – Vidéo $3 sur $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/gl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "por <a href='$1'>$2</a> – Vídeo $3 de $4",
"message": "por <a href='$1' target='_blank'>$2</a> – Vídeo $3 de $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/he/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "מאת <a href='$1'>$2</a> – סרט $3 מתוך $4",
"message": "מאת <a href='$1' target='_blank'>$2</a> – סרט $3 מתוך $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/hi/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a> द्वारा – $4 में से $3 नंबरी वीडियो",
"message": "<a href='$1' target='_blank'>$2</a> द्वारा – $4 में से $3 नंबरी वीडियो",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/hy/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "հեղինակ՝ <a href='$1'>$2</a> – տեսանյութ $3 $4-ից",
"message": "հեղինակ՝ <a href='$1' target='_blank'>$2</a> – տեսանյութ $3 $4-ից",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/ia/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "per <a href='$1'>$2</a> – Video $3 de $4",
"message": "per <a href='$1' target='_blank'>$2</a> – Video $3 de $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/id/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "oleh <a href='$1'>$2</a> – Video $3 dari $4",
"message": "oleh <a href='$1' target='_blank'>$2</a> – Video $3 dari $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "di <a href='$1'>$2</a> - Video $3 di $4",
"message": "di <a href='$1' target='_blank'>$2</a> - Video $3 di $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a>に帰属 – 動画 $4件中の$3件目",
"message": "<a href='$1' target='_blank'>$2</a>に帰属 – 動画 $4件中の$3件目",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/kk-cyrl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "ауторы: <a href='$1'>$2</a> — $3/$4 видео",
"message": "ауторы: <a href='$1' target='_blank'>$2</a> — $3/$4 видео",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "만든이: <a href='$1'>$2</a> – 동영상 $3 / $4",
"message": "만든이: <a href='$1' target='_blank'>$2</a> – 동영상 $3 / $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/krc/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a> – Видео $3/$4",
"message": "<a href='$1' target='_blank'>$2</a> – Видео $3/$4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/lmo/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "de <a href='$1'>$2</a> - Video $3 de $4",
"message": "de <a href='$1' target='_blank'>$2</a> - Video $3 de $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/mk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "од <a href='$1'>$2</a> — Видео $3 од $4",
"message": "од <a href='$1' target='_blank'>$2</a> — Видео $3 од $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/ms/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "karya <a href='$1'>$2</a> – Video $3 dari $4",
"message": "karya <a href='$1' target='_blank'>$2</a> – Video $3 dari $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/nb/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "av <a href='$1'>$2</a> – video $3 av $4",
"message": "av <a href='$1' target='_blank'>$2</a> – video $3 av $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/pt-br/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "por <a href='$1'>$2</a> – Vídeo $3 de $4",
"message": "por <a href='$1' target='_blank'>$2</a> – Vídeo $3 de $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/pt/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "de <a href='$1'>$2</a> – Vídeo $3 de $4",
"message": "de <a href='$1' target='_blank'>$2</a> – Vídeo $3 de $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "авторство: <a href='$1'>$2</a> – видео $3 в $4",
"message": "авторство: <a href='$1' target='_blank'>$2</a> – видео $3 в $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/scn/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "di <a href='$1'>$2</a> – Vìdiu $3 di $4",
"message": "di <a href='$1' target='_blank'>$2</a> – Vìdiu $3 di $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/sl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "avtor <a href='$1'>$2</a> – video $3 od $4",
"message": "avtor <a href='$1' target='_blank'>$2</a> – video $3 od $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/sv/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "av <a href='$1'>$2</a> – Video $3 av $4",
"message": "av <a href='$1' target='_blank'>$2</a> – Video $3 av $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/tl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "ni <a href='$1'>$2</a> - Video $3 ng $4",
"message": "ni <a href='$1' target='_blank'>$2</a> - Video $3 ng $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/tr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "<a href='$1'>$2</a> – Video $3/$4",
"message": "<a href='$1' target='_blank'>$2</a> – Video $3/$4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": ""
},
"si_panel_videos_gallery_attribution": {
"message": "від <a href='$1'>$2</a> – Відео $3 із $4",
"message": "від <a href='$1' target='_blank'>$2</a> – Відео $3 із $4",
"description": ""
},
"si_panel_videos_empty": {
Expand Down
Loading

0 comments on commit 90c0828

Please sign in to comment.