From e3cd8956d610507d11c53589cb5650ab54bd7a2b Mon Sep 17 00:00:00 2001 From: Avris Date: Wed, 11 Nov 2020 00:47:44 +0100 Subject: [PATCH] #95 [refactor] rename "template" to "pronoun" --- components/Example.vue | 8 +- components/Header.vue | 2 +- components/Literature.vue | 16 +-- components/NormativeBadge.vue | 2 +- components/SourceSubmitForm.vue | 10 +- locale/_/config.suml | 2 +- .../{templates => pronouns}/EnglishTable.vue | 0 .../{templates => pronouns}/GrammarTables.vue | 2 +- locale/_/{templates => pronouns}/examples.tsv | 0 locale/_/{templates => pronouns}/morphemes.js | 0 .../pronounGroups.tsv} | 2 +- .../templates.tsv => pronouns/pronouns.tsv} | 0 locale/_/translations.suml | 2 +- locale/en/config.suml | 15 ++- .../{templates => pronouns}/EnglishTable.vue | 0 .../{templates => pronouns}/GrammarTables.vue | 12 +-- .../en/{templates => pronouns}/examples.tsv | 0 .../en/{templates => pronouns}/morphemes.js | 0 .../pronounGroups.tsv} | 2 +- .../templates.tsv => pronouns/pronouns.tsv} | 0 locale/en/translations.suml | 9 +- locale/pl/config.suml | 4 +- locale/pl/pronouns/EnglishTable.vue | 72 +++++++++++++ .../{templates => pronouns}/GrammarTables.vue | 23 ++-- .../pl/{templates => pronouns}/examples.tsv | 0 .../pl/{templates => pronouns}/morphemes.js | 0 .../pronounGroups.tsv} | 2 +- .../templates.tsv => pronouns/pronouns.tsv} | 0 locale/pl/templates/EnglishTable.vue | 72 ------------- locale/pl/translations.suml | 6 +- nuxt.config.js | 6 +- pages/index.vue | 2 +- routes/any.vue | 26 ++--- routes/api.vue | 2 +- routes/english.vue | 12 +-- routes/homepage.vue | 102 +++++++++--------- routes/profile.vue | 26 ++--- routes/profileEditor.vue | 11 +- routes/{template.vue => pronoun.vue} | 72 ++++++------- routes/sources.vue | 52 ++++----- server/index.js | 2 +- server/routes/banner.js | 26 ++--- server/routes/{templates.js => pronouns.js} | 18 ++-- server/routes/sources.js | 2 +- src/buildPronoun.js | 68 ++++++++++++ src/buildTemplate.js | 68 ------------ src/classes.js | 56 +++++----- src/data.js | 36 +++---- 48 files changed, 433 insertions(+), 417 deletions(-) rename locale/_/{templates => pronouns}/EnglishTable.vue (100%) rename locale/_/{templates => pronouns}/GrammarTables.vue (73%) rename locale/_/{templates => pronouns}/examples.tsv (100%) rename locale/_/{templates => pronouns}/morphemes.js (100%) rename locale/_/{templates/templateGroups.tsv => pronouns/pronounGroups.tsv} (97%) rename locale/_/{templates/templates.tsv => pronouns/pronouns.tsv} (100%) rename locale/en/{templates => pronouns}/EnglishTable.vue (100%) rename locale/en/{templates => pronouns}/GrammarTables.vue (60%) rename locale/en/{templates => pronouns}/examples.tsv (100%) rename locale/en/{templates => pronouns}/morphemes.js (100%) rename locale/en/{templates/templateGroups.tsv => pronouns/pronounGroups.tsv} (97%) rename locale/en/{templates/templates.tsv => pronouns/pronouns.tsv} (100%) create mode 100644 locale/pl/pronouns/EnglishTable.vue rename locale/pl/{templates => pronouns}/GrammarTables.vue (52%) rename locale/pl/{templates => pronouns}/examples.tsv (100%) rename locale/pl/{templates => pronouns}/morphemes.js (100%) rename locale/pl/{templates/templateGroups.tsv => pronouns/pronounGroups.tsv} (99%) rename locale/pl/{templates/templates.tsv => pronouns/pronouns.tsv} (100%) delete mode 100644 locale/pl/templates/EnglishTable.vue rename routes/{template.vue => pronoun.vue} (59%) rename server/routes/{templates.js => pronouns.js} (68%) create mode 100644 src/buildPronoun.js delete mode 100644 src/buildTemplate.js diff --git a/components/Example.vue b/components/Example.vue index d1c7bdf8..6a60932b 100644 --- a/components/Example.vue +++ b/components/Example.vue @@ -1,11 +1,11 @@ @@ -14,7 +14,7 @@ export default { props: { example: { required: true }, - template: { required: true }, + pronoun: { required: true }, counter: { default: 0 }, link: { type: Boolean }, } diff --git a/components/Header.vue b/components/Header.vue index f062370a..8796aed8 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -62,7 +62,7 @@ icon: 'home', text: this.$t('home.header'), textLong: this.$t('home.headerLong'), - extra: ['all', this.config.template.any.route], + extra: ['all', this.config.pronouns.any.route], }); if (this.config.sources.enabled) { diff --git a/components/Literature.vue b/components/Literature.vue index 6fd0229f..52d839c0 100644 --- a/components/Literature.vue +++ b/components/Literature.vue @@ -11,12 +11,12 @@

- template.alt.header + pronouns.alt.header ({{ option.replace(/&/g, glue) }}) - {{ getTemplate(templates, option).description }} - ({{ getTemplate(templates, option).name(glue) }}) + {{ getPronoun(pronouns, option).description }} + ({{ getPronoun(pronouns, option).name(glue) }})

@@ -27,8 +27,8 @@ diff --git a/locale/pl/templates/GrammarTables.vue b/locale/pl/pronouns/GrammarTables.vue similarity index 52% rename from locale/pl/templates/GrammarTables.vue rename to locale/pl/pronouns/GrammarTables.vue index 2bd09cf0..92bff6c3 100644 --- a/locale/pl/templates/GrammarTables.vue +++ b/locale/pl/pronouns/GrammarTables.vue @@ -19,12 +19,13 @@ - {{ selectedTemplate.getMorpheme('pronoun_n', counter) }} - {{ selectedTemplate.getMorpheme('pronoun_g', counter) }} / {{ selectedTemplate.getMorpheme('pronoun_g_acc', counter) }} - {{ selectedTemplate.getMorpheme('pronoun_d', counter) }} - {{ selectedTemplate.getMorpheme('pronoun_a', counter) }} - {{ selectedTemplate.getMorpheme('pronoun_i', counter) }} - {{ selectedTemplate.getMorpheme('pronoun_l', counter) }} + {{ selectedPronoun.getMorpheme('pronoun_n', counter) }} + {{ selectedPronoun.getMorpheme('pronoun_g', counter) }} / {{ + selectedPronoun.getMorpheme('pronoun_g_acc', counter) }} + {{ selectedPronoun.getMorpheme('pronoun_d', counter) }} + {{ selectedPronoun.getMorpheme('pronoun_a', counter) }} + {{ selectedPronoun.getMorpheme('pronoun_i', counter) }} + {{ selectedPronoun.getMorpheme('pronoun_l', counter) }} @@ -42,10 +43,10 @@ - -{{ selectedTemplate.getMorpheme('verb_middle_inter', counter) }}{{ selectedTemplate.isPlural(counter) ? 'śmy' : 'm'}} - -{{ selectedTemplate.getMorpheme('verb_middle_inter', counter) }}{{ selectedTemplate.isPlural(counter) ? 'ście' : 'ś'}} - -{{ selectedTemplate.getMorpheme('verb_end_about', counter) }} - -{{ selectedTemplate.getMorpheme('adjective_n', counter) }} + -{{ selectedPronoun.getMorpheme('verb_middle_inter', counter) }}{{selectedPronoun.isPlural(counter) ? 'śmy' : 'm'}} + -{{ selectedPronoun.getMorpheme('verb_middle_inter', counter) }}{{selectedPronoun.isPlural(counter) ? 'ście' : 'ś'}} + -{{ selectedPronoun.getMorpheme('verb_end_about', counter) }} + -{{ selectedPronoun.getMorpheme('adjective_n', counter) }} @@ -56,7 +57,7 @@ diff --git a/locale/pl/translations.suml b/locale/pl/translations.suml index 0a066fc3..510aa33f 100644 --- a/locale/pl/translations.suml +++ b/locale/pl/translations.suml @@ -40,7 +40,7 @@ home: „{/oni=dzwonili} z gazowni”, „będę robić”, itp. Tutaj idziemy po prostu o krok dalej. - templates: 'Propozycje form' + pronouns: 'Propozycje form' generator: header: 'Generator form' description: > @@ -52,7 +52,7 @@ home: alt: 'Możesz tu również wpisać formy wymienne w każdym polu z osobna, np. jego&jej = „jego” lub „jej”.' whatisit: 'O co chodzi w tej stronie?' -template: +pronouns: examples: 'Przykłady użycia w zdaniu' plural: 'Liczba mnoga' intro: 'Moje zaimki to' @@ -89,7 +89,7 @@ sources: submit: header: 'Zgłoś przykład do dodania' action: 'Zgłoś' - templates: 'Które zaimki/formy są użyte?' + pronouns: 'Które zaimki/formy są użyte?' type: 'Rodzaj źródła kultury' author: 'Autor' title: 'Tytuł' diff --git a/nuxt.config.js b/nuxt.config.js index 69559bcb..59bce64d 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -156,13 +156,13 @@ export default { } } - if (config.template.enabled) { - routes.push({ path: '/' + config.template.any.route, component: resolve(__dirname, 'routes/any.vue') }); + if (config.pronouns.enabled) { + routes.push({ path: '/' + config.pronouns.any.route, component: resolve(__dirname, 'routes/any.vue') }); } routes.push({ path: '/api', component: resolve(__dirname, 'routes/api.vue') }); - routes.push({ name: 'all', path: '*', component: resolve(__dirname, 'routes/template.vue') }); + routes.push({ name: 'all', path: '*', component: resolve(__dirname, 'routes/pronoun.vue') }); }, }, } diff --git a/pages/index.vue b/pages/index.vue index 7d8d805f..351cad59 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,5 +1,5 @@ diff --git a/routes/any.vue b/routes/any.vue index f8950a01..825ccf44 100644 --- a/routes/any.vue +++ b/routes/any.vue @@ -2,18 +2,18 @@

- template.intro: + pronouns.intro:

- template.any.short + pronouns.any.short

- template.any.description - (template.any.options) + pronouns.any.description + (pronouns.any.options)

@@ -22,18 +22,18 @@

- template.examples: + pronouns.examples:

  • - +
- +
@@ -49,7 +49,7 @@