From b0addcb5bd41b1bab3431f6936775d64dd6ed6ea Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 9 Mar 2023 14:53:24 +1300 Subject: [PATCH 1/2] ENH Update translations (#359) --- .tx/config | 15 +++++++++++++++ client/lang/en.js | 14 ++++++++++++++ client/lang/src/en.json | 6 ++++++ composer.json | 3 ++- javascript/GridFieldExtensions.js | 11 ++++++++--- lang/de_DE.yml | 6 +++--- lang/en.yml | 2 ++ lang/es_ES.yml | 6 +++--- lang/et_EE.yml | 2 +- lang/fi_FI.yml | 6 +++--- lang/it_IT.yml | 6 +++--- lang/nl_NL.yml | 6 +++--- lang/ru_RU.yml | 6 +++--- lang/sk.yml | 4 ++-- 14 files changed, 68 insertions(+), 25 deletions(-) create mode 100644 .tx/config create mode 100644 client/lang/en.js create mode 100644 client/lang/src/en.json diff --git a/.tx/config b/.tx/config new file mode 100644 index 0000000..d78e098 --- /dev/null +++ b/.tx/config @@ -0,0 +1,15 @@ +[main] +host = https://www.transifex.com + +[o:silverstripe:p:silverstripe-gridfieldextensions:r:master] +file_filter = lang/.yml +source_file = lang/en.yml +source_lang = en +type = YML + +[o:silverstripe:p:silverstripe-gridfieldextensions:r:master-js] +file_filter = client/lang/src/.json +source_file = client/lang/src/en.json +source_lang = en +type = KEYVALUEJSON + diff --git a/client/lang/en.js b/client/lang/en.js new file mode 100644 index 0000000..7bbdfa1 --- /dev/null +++ b/client/lang/en.js @@ -0,0 +1,14 @@ +// This file was generated by silverstripe/tx-translator from client/lang/src/en.json. +// See https://github.com/silverstripe/silverstripe-tx-translator for details +if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') { + if (typeof(console) !== 'undefined') { // eslint-disable-line no-console + console.error('Class ss.i18n not defined'); // eslint-disable-line no-console + } +} else { + ss.i18n.addDictionary('en', { + "GridFieldExtensions.CONFIRMDEL": "Are you sure you want to delete this?", + "GridFieldExtensions.ADD_CLASS": "Add: {classname}", + "GridFieldExtensions.OPEN_SEARCH_FILTER": "Open search and filter", + "GridFieldExtensions.SAVE_PUBLISH": "Save & publish" +}); +} \ No newline at end of file diff --git a/client/lang/src/en.json b/client/lang/src/en.json new file mode 100644 index 0000000..2a56943 --- /dev/null +++ b/client/lang/src/en.json @@ -0,0 +1,6 @@ +{ + "GridFieldExtensions.CONFIRMDEL": "Are you sure you want to delete this?", + "GridFieldExtensions.ADD_CLASS": "Add: {classname}", + "GridFieldExtensions.OPEN_SEARCH_FILTER": "Open search and filter", + "GridFieldExtensions.SAVE_PUBLISH": "Save & publish" +} \ No newline at end of file diff --git a/composer.json b/composer.json index b8a89a7..006f80a 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,8 @@ ], "expose": [ "css", - "javascript" + "javascript", + "client/lang" ] }, "replace": { diff --git a/javascript/GridFieldExtensions.js b/javascript/GridFieldExtensions.js index 60529d7..2d7accf 100644 --- a/javascript/GridFieldExtensions.js +++ b/javascript/GridFieldExtensions.js @@ -243,7 +243,11 @@ const classes = this.data('classes'); const liHtml = Object.keys(classes).map(className => { const link = hrefTemplate.replace('{class}', className); - return `
  • Add: ${classes[className]}
  • `; + const linkText = ss.i18n.inject( + ss.i18n._t('GridFieldExtensions.ADD_CLASS', 'Add: {classname}'), + {classname: classes[className]} + ); + return `
  • ${linkText}
  • `; }); const listElement = $(``); @@ -336,7 +340,8 @@ content = ''; self.addClass('show-filter').find('.grid-field__filter-header').show(); } else { - content = ''; + const contentTitle = ss.i18n._t('GridFieldExtensions.OPEN_SEARCH_FILTER', 'Open search and filter'); + content = ``; self.removeClass('show-filter').find('.grid-field__filter-header').hide(); } @@ -364,7 +369,7 @@ publish.removeClass('font-icon-tick'); publish.addClass('btn-primary'); publish.addClass('font-icon-rocket'); - publish.find('.btn__title').html('Save & publish'); + publish.find('.btn__title').html(ss.i18n._t('GridFieldExtensions.SAVE_PUBLISH', 'Save & publish')); } }, error: function (e) { diff --git a/lang/de_DE.yml b/lang/de_DE.yml index 67737c3..c8e4b45 100644 --- a/lang/de_DE.yml +++ b/lang/de_DE.yml @@ -1,9 +1,9 @@ de_DE: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Kein Ergebnis' - RESULTS: 'Ergebnisse' + RESULTS: Ergebnisse GridFieldExtensions: - ADD: 'Hinzufügen' + ADD: Hinzufügen ADDEXISTING: 'Bestehenden Eintrag hinzufügen' - SEARCH: 'Suche' + SEARCH: Suche SELECTTYPETOCREATE: '(Bitte Typ auswählen)' diff --git a/lang/en.yml b/lang/en.yml index 5792708..27fde16 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -10,5 +10,7 @@ en: RESULTS: Results SEARCH: Search SELECTTYPETOCREATE: '(Select type to create)' + Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension: + NEW: 'Add new record' Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator: SHOW: Show diff --git a/lang/es_ES.yml b/lang/es_ES.yml index 2d50fae..614de6f 100644 --- a/lang/es_ES.yml +++ b/lang/es_ES.yml @@ -1,9 +1,9 @@ es_ES: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'No hay items.' - RESULTS: 'Resultados' + RESULTS: Resultados GridFieldExtensions: - ADD: 'Agregar' + ADD: Agregar ADDEXISTING: 'Agregar existente' - SEARCH: 'Buscar' + SEARCH: Buscar SELECTTYPETOCREATE: '(Seleccionar tipo para crear)' diff --git a/lang/et_EE.yml b/lang/et_EE.yml index 3664d34..701eb85 100644 --- a/lang/et_EE.yml +++ b/lang/et_EE.yml @@ -1,7 +1,7 @@ et_EE: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Kirjed puuduvad.' - RESULTS: 'Tulemused' + RESULTS: Tulemused GridFieldExtensions: ADD: Lisa ADDEXISTING: 'Lisa olemasolev' diff --git a/lang/fi_FI.yml b/lang/fi_FI.yml index 36c22d6..84820e3 100644 --- a/lang/fi_FI.yml +++ b/lang/fi_FI.yml @@ -1,9 +1,9 @@ fi_FI: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Ei kohteita' - RESULTS: 'Tulokset' + RESULTS: Tulokset GridFieldExtensions: - ADD: 'Lisää' + ADD: Lisää ADDEXISTING: 'Lisää olemassa oleva' - SEARCH: 'Etsi' + SEARCH: Etsi SELECTTYPETOCREATE: 'Valitse lisättävä tyyppi' diff --git a/lang/it_IT.yml b/lang/it_IT.yml index d65ef51..48a15e6 100644 --- a/lang/it_IT.yml +++ b/lang/it_IT.yml @@ -1,9 +1,9 @@ it_IT: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Nessun elemento.' - RESULTS: 'Risultati' + RESULTS: Risultati GridFieldExtensions: - ADD: 'Aggiungi' + ADD: Aggiungi ADDEXISTING: 'Aggiungi esistente' - SEARCH: 'Cerca' + SEARCH: Cerca SELECTTYPETOCREATE: '(Seleziona tipo per creare)' diff --git a/lang/nl_NL.yml b/lang/nl_NL.yml index 7ce2e5e..471362c 100644 --- a/lang/nl_NL.yml +++ b/lang/nl_NL.yml @@ -1,9 +1,9 @@ nl_NL: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Geen resultaten gevonden.' - RESULTS: 'Resultaten' + RESULTS: Resultaten GridFieldExtensions: - ADD: 'Toevoegen' + ADD: Toevoegen ADDEXISTING: 'Bestaande toevoegen' - SEARCH: 'Zoeken' + SEARCH: Zoeken SELECTTYPETOCREATE: '(Selecteer type om te creeën)' diff --git a/lang/ru_RU.yml b/lang/ru_RU.yml index 0019223..b2b40ff 100644 --- a/lang/ru_RU.yml +++ b/lang/ru_RU.yml @@ -1,9 +1,9 @@ ru_RU: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Нет элементов.' - RESULTS: 'Результаты' + RESULTS: Результаты GridFieldExtensions: - ADD: 'Добавить' + ADD: Добавить ADDEXISTING: 'Добавить существующий' - SEARCH: 'Поиск' + SEARCH: Поиск SELECTTYPETOCREATE: '(Выберите тип для создания)' diff --git a/lang/sk.yml b/lang/sk.yml index 589430c..8566a3e 100644 --- a/lang/sk.yml +++ b/lang/sk.yml @@ -1,9 +1,9 @@ sk: GridFieldAddExistingSearchHandler.ss: NOITEMS: 'Nie sú tu žiadne položky.' - RESULTS: 'Výsledky' + RESULTS: Výsledky GridFieldExtensions: ADD: Pridať - ADDEXISTING: Pridať existujúci + ADDEXISTING: 'Pridať existujúci' SEARCH: Hľadať SELECTTYPETOCREATE: '(Prosím, vyberte typ)' From 5566b05c9d4d6a42b6c1ec6c47f9f96a786687c6 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 21 Mar 2023 12:05:45 +1300 Subject: [PATCH 2/2] MNT Use gha-dispatch-ci --- .github/workflows/ci.yml | 5 ----- .github/workflows/dispatch-ci.yml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dispatch-ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd2be36..bf02210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,8 @@ on: push: pull_request: workflow_dispatch: - # Every Sunday at 12:10pm UTC - schedule: - - cron: '10 12 * * 0' jobs: ci: name: CI - # Only run cron on the symbiote account - if: (github.event_name == 'schedule' && github.repository_owner == 'symbiote') || (github.event_name != 'schedule') uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 diff --git a/.github/workflows/dispatch-ci.yml b/.github/workflows/dispatch-ci.yml new file mode 100644 index 0000000..ad32c8a --- /dev/null +++ b/.github/workflows/dispatch-ci.yml @@ -0,0 +1,16 @@ +name: Dispatch CI + +on: + # At 12:10 PM UTC, only on Sunday and Monday + schedule: + - cron: '10 12 * * 0,1' + +jobs: + dispatch-ci: + name: Dispatch CI + # Only run cron on the silverstripe account + if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule') + runs-on: ubuntu-latest + steps: + - name: Dispatch CI + uses: silverstripe/gha-dispatch-ci@v1