diff --git a/i18n.toml b/i18n.toml new file mode 100644 index 0000000..f32b7c4 --- /dev/null +++ b/i18n.toml @@ -0,0 +1 @@ +fallback_language = "en-ca" diff --git a/migrations/20230408203101_create_languages.down.sql b/migrations/20230408203101_create_languages.down.sql new file mode 100644 index 0000000..87c8d8f --- /dev/null +++ b/migrations/20230408203101_create_languages.down.sql @@ -0,0 +1,2 @@ +-- Add down migration script here +DROP TABLE IF EXISTS supported_languages; diff --git a/migrations/20230408203101_create_languages.up.sql b/migrations/20230408203101_create_languages.up.sql new file mode 100644 index 0000000..e8907e7 --- /dev/null +++ b/migrations/20230408203101_create_languages.up.sql @@ -0,0 +1,8 @@ +-- Add up migration script here +CREATE TABLE IF NOT EXISTS supported_languages ( + id SERIAL PRIMARY KEY NOT NULL, + -- this will be used in the url, like "/en/...", or "/fr/..." + short_name VARCHAR(2) NOT NULL, + -- this will be the native name of the langauge on the page where you can select your language + native_name VARCHAR(32) NOT NULL +); diff --git a/migrations/20230408204846_add_languages.down.sql b/migrations/20230408204846_add_languages.down.sql new file mode 100644 index 0000000..45337e4 --- /dev/null +++ b/migrations/20230408204846_add_languages.down.sql @@ -0,0 +1,3 @@ +-- Add down migration script here +DELETE FROM supported_languages +WHERE id=1 OR id=2; diff --git a/migrations/20230408204846_add_languages.up.sql b/migrations/20230408204846_add_languages.up.sql new file mode 100644 index 0000000..eb1e790 --- /dev/null +++ b/migrations/20230408204846_add_languages.up.sql @@ -0,0 +1,6 @@ +-- Add up migration script here +INSERT INTO supported_languages + (id, short_name, native_name) +VALUES + (1, 'en', 'English'), + (2, 'fr', 'Français'); diff --git a/templates/fi.yml b/templates/fi.yml new file mode 100644 index 0000000..24a56f2 --- /dev/null +++ b/templates/fi.yml @@ -0,0 +1 @@ +hello: Tikkitakka diff --git a/templates/language_list.html b/templates/language_list.html new file mode 100644 index 0000000..ece5f39 --- /dev/null +++ b/templates/language_list.html @@ -0,0 +1,16 @@ +{% extends "master.html" %} + +{% block title %}Select Your Language{% endblock %} + +{% block content %} +

Select Your Language

+ {% if languages.len() > 0 %} + + {% else %} +

No languages were found. This is probably very.

+ {% endif %} +{% endblock %} diff --git a/translations/en-CA.yml b/translations/en-CA.yml new file mode 100644 index 0000000..f3d9344 --- /dev/null +++ b/translations/en-CA.yml @@ -0,0 +1,5 @@ +test: 123 +welcome: Welcome! +test2: 123123 +message: Can we %{go} to the store? +hello: Hello World diff --git a/translations/en.json b/translations/en.json deleted file mode 100644 index 54c9f7c..0000000 --- a/translations/en.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "phrases": { - "urlGame": "game", - "urlDivision": "division", - "urlLeague": "league", - "ibihfLeagues": "IBIHF Leagues", - "goals": "Goals", - "assists": "Assists", - "period": "Period" - } -} diff --git a/translations/en.xml b/translations/en.xml deleted file mode 100644 index 7ddbedd..0000000 --- a/translations/en.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - game - division - league - IBIHF Leagues - Goals - Assists - Period - diff --git a/translations/fr-CA.yml b/translations/fr-CA.yml new file mode 100644 index 0000000..c97c232 --- /dev/null +++ b/translations/fr-CA.yml @@ -0,0 +1,2 @@ +test: Test +welcome: Beinvenue diff --git a/translations/fr.json b/translations/fr.json deleted file mode 100644 index 9d6d839..0000000 --- a/translations/fr.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "phrases": { - "urlGame": "match", - "urlDivision": "division", - "urlLeague": "league", - "ibihfLeagues": "Leagues de FIDHS", - "goals": "But", - "assists": "Assisté", - "period": "Période" - } -} diff --git a/translations/fr.xml b/translations/fr.xml deleted file mode 100644 index 92ba359..0000000 --- a/translations/fr.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - match - division - league - Leagues de FIDHS - But - Assisté - Période -