Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations for tab-alpha.js and vocab-search.js (excluding Aria tags) (#1722) #1723

Merged
merged 23 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6e1d1cf
New branch created
miguelvaara Dec 17, 2024
c455fb4
Translation functionality added, but the code has not yet been validated
miguelvaara Dec 17, 2024
8555dbf
The translation operations related to the types of concepts described…
miguelvaara Dec 18, 2024
a15bf27
The msgs property was removed from the SKOSMOS object and all its usa…
miguelvaara Dec 18, 2024
b02ecfe
A small quick fix related to the use of language features, which aros…
miguelvaara Dec 19, 2024
de55604
A tiny fix
miguelvaara Dec 19, 2024
1642528
New branch created
miguelvaara Dec 17, 2024
122a9cc
Translation functionality added, but the code has not yet been validated
miguelvaara Dec 17, 2024
75059db
The translation operations related to the types of concepts described…
miguelvaara Dec 18, 2024
2c62b52
The msgs property was removed from the SKOSMOS object and all its usa…
miguelvaara Dec 18, 2024
970e14f
Reverting changes that were intended to be in the upstream.
miguelvaara Dec 19, 2024
0dea9e8
Merge branch 'issue1722-add-translations-for-front-end-components' of…
miguelvaara Dec 19, 2024
14b382e
Code style clean-ups
miguelvaara Dec 19, 2024
c2e3351
Add wait commands
miguelvaara Dec 19, 2024
279f420
A simplified implementation for handling type translations.
miguelvaara Jan 21, 2025
09f7374
Moved out of the global scope to local scope and refactored into arro…
miguelvaara Jan 21, 2025
a3def6d
Moved to the computed properties and not called as a function anymore
miguelvaara Jan 21, 2025
19cda76
Unnecessary data property removed
miguelvaara Jan 21, 2025
fff32b4
A simplified implementation of loading message
miguelvaara Jan 21, 2025
88efaa0
JavaScript code style errors fixed
miguelvaara Jan 22, 2025
0aacdc9
Lined up with the main branchs as needed
miguelvaara Jan 22, 2025
e61114c
Overriding main
miguelvaara Jan 22, 2025
5969473
Unnecessary wait commands removed
miguelvaara Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
440 changes: 227 additions & 213 deletions resource/js/tab-alpha.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions resource/js/vocab-counts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ function startResourceCountsApp () {
resourceCountsApp.mount('#resource-counts')
}

function waitForTranslationService () {
const waitForTranslationServiceVocabCounts = () => {
if (typeof $t !== 'undefined') {
startResourceCountsApp()
} else {
setTimeout(waitForTranslationService, 50)
setTimeout(waitForTranslationServiceVocabCounts, 50)
}
}

waitForTranslationService()
waitForTranslationServiceVocabCounts()
660 changes: 339 additions & 321 deletions resource/js/vocab-search.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions resource/translations/messages.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"Group index": "Group index",
"Group-nav": "Groups",
"Hier-nav": "Hierarchy",
"http://www.yso.fi/onto/yso-meta/Concept": "General concept",
"http://www.yso.fi/onto/yso-meta/Hierarchy": "Hierarchy",
"http://www.yso.fi/onto/yso-meta/Individual": "Individual",
"Leave this field blank": "Leave this field blank",
"Limit search": "Limit search",
"Loading": "Loading",
Expand All @@ -45,6 +48,7 @@
"No results": "No results",
"Not to a specific vocabulary": "Not to a specific vocabulary",
"Search": "Search",
"Search...": "Search...",
"Search from vocabulary": "Search from vocabulary",
"Search language: any": "Any language",
"Search options": "Search options",
Expand Down
4 changes: 4 additions & 0 deletions resource/translations/messages.fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"Hier-nav": "Hierarkia",
"Hierarchical listing of vocabulary concepts": "Hierarkian mukainen lista k\u00e4sitteist\u00e4",
"Hierarchical listing of vocabulary concepts and groupings": "Hierarkian mukainen lista k\u00e4sitteist\u00e4 ja ryhmist\u00e4",
"http://www.yso.fi/onto/yso-meta/Concept": "Yleiskäsite",
"http://www.yso.fi/onto/yso-meta/Hierarchy": "Hierarkisoiva käsite",
"http://www.yso.fi/onto/yso-meta/Individual": "Yksilöivä käsite",
"Information": "Tietoja",
"Interface language": "K\u00e4ytt\u00f6kieli",
"Leave this field blank": "J\u00e4t\u00e4 t\u00e4m\u00e4 kentt\u00e4 tyhj\u00e4ksi",
Expand All @@ -72,6 +75,7 @@
"Resource counts by type": "Resurssien lukum\u00e4\u00e4r\u00e4 tyypeitt\u00e4in",
"Retry": "Yrit\u00e4 uudelleen",
"Search": "Hae",
"Search...": "Hae...",
"Search from selected vocabularies": "Hae valituista sanastoista",
"Search from vocabulary": "Hae sanastosta",
"Search language: any": "kaikilla kielill\u00e4",
Expand Down
1 change: 1 addition & 0 deletions resource/translations/messages.se.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"Resource counts by type": "Resurssaid lohkomearri tiippaid mielde",
"Retry": "Iskka o\u0111\u0111asit",
"Search": "Oza",
"Search...": "Oza...",
"Search from selected vocabularies": "Oza v\u00e1lljejuvvon s\u00e1tner\u00e1juin",
"Search from vocabulary": "Oza s\u00e1tner\u00e1jus",
"Search language: any": "Buot gielat",
Expand Down
4 changes: 4 additions & 0 deletions resource/translations/messages.sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"Hier-nav": "Hierarki",
"Hierarchical listing of vocabulary concepts": "Hierarkisk lista \u00f6ver begrepp",
"Hierarchical listing of vocabulary concepts and groupings": "Hierarkisk lista av begrepp och grupper",
"http://www.yso.fi/onto/yso-meta/Concept": "Allmänbegrepp",
"http://www.yso.fi/onto/yso-meta/Hierarchy": "Hierarki",
"http://www.yso.fi/onto/yso-meta/Individual": "Identifierande begrepp",
"Information": "Information",
"Interface language": "Gr\u00e4nssnittsspr\u00e5k",
"Leave this field blank": "Leave this field blank",
Expand All @@ -72,6 +75,7 @@
"Resource counts by type": "Antal resurs enligt typ",
"Retry": "F\u00f6rs\u00f6k igen",
"Search": "S\u00f6k",
"Search...": "S\u00f6k...",
"Search from selected vocabularies": "S\u00f6k i utvalda vokabul\u00e4rer",
"Search from vocabulary": "S\u00f6k i vokabul\u00e4r",
"Search language: any": "p\u00e5 alla spr\u00e5k",
Expand Down
17 changes: 1 addition & 16 deletions src/view/scripts.inc.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,7 @@ window.SKOSMOS = {
{%- endif -%}
"baseHref": "{{ BaseHref }}",
"language_strings": { {% for lang in request.vocab.config.languages %}"{{ lang }}": "{{ mockup_translations[request.lang][lang] }}", {% endfor -%}
"all": "{{ mockup_translations[request.lang].all }}" },
"msgs" : { "fi": { "No results": "Ei hakutuloksia",
"http://www.yso.fi/onto/yso-meta/Concept": "Yleiskäsite",
"http://www.yso.fi/onto/yso-meta/Hierarchy": "Hierarkisoiva käsite",
"skos:Concept": "Käsite",
"Loading more items": "Ladataan sisältöä"},
"sv": { "No results": "Inga sökresultat",
"http://www.yso.fi/onto/yso-meta/Concept": "Allmänbegrepp",
"http://www.yso.fi/onto/yso-meta/Hierarchy": "Hierarki",
"skos:Concept": "Begrepp",
"Loading more items": "Laddar mera resultat"},
"en": { "No results": "No results",
"http://www.yso.fi/onto/yso-meta/Concept": "General concept",
"http://www.yso.fi/onto/yso-meta/Hierarchy": "Hierarchy",
"skos:Concept": "Concept",
"Loading more items": "Loading more items"}}
"all": "{{ mockup_translations[request.lang].all }}" }
}
</script>

Expand Down
Loading