generated from alpha-canada-ca/.github
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from canada-ca/hotfix/localisation/dates
fix: Update fr/index.html
- Loading branch information
Showing
4 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Strings for dates | ||
# language English | ||
abbr_weekday: | ||
en: | ||
- Sun | ||
- Mon | ||
- Tue | ||
- Wed | ||
- Thu | ||
- Fri | ||
- Sat | ||
fr: | ||
- Dim | ||
- Lun | ||
- Mar | ||
- Mer | ||
- Jeu | ||
- Ven | ||
- Sam | ||
full_weekday: | ||
en: | ||
- Sunday | ||
- Monday | ||
- Tuesday | ||
- Wednesday | ||
- Thursday | ||
- Friday | ||
- Saturday | ||
fr: | ||
- Dimanche | ||
- Lundi | ||
- Mardi | ||
- Mercredi | ||
- Jeudi | ||
- Vendredi | ||
- Samedi | ||
abbr_month: | ||
en: | ||
- Jan | ||
- Feb | ||
- Mar | ||
- Apr | ||
- May | ||
- Jun | ||
- Jul | ||
- Aug | ||
- Sep | ||
- Oct | ||
- Nov | ||
- Dec | ||
fr: | ||
- jan. | ||
- fév. | ||
- mar. | ||
- avr. | ||
- mai | ||
- juin | ||
- juil. | ||
- août | ||
- sept. | ||
- oct. | ||
- nov. | ||
- déc. | ||
full_month: | ||
en: | ||
- January | ||
- February | ||
- March | ||
- April | ||
- May | ||
- June | ||
- July | ||
- August | ||
- September | ||
- October | ||
- November | ||
- December | ||
fr: | ||
- janvier | ||
- février | ||
- mars | ||
- avril | ||
- mai | ||
- juin | ||
- juillet | ||
- août | ||
- septembre | ||
- octobre | ||
- novembre | ||
- décembre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{%- comment -%} | ||
This include allows to translate the days and months in the date by using strings in _data/locales/date.yml | ||
This include can be called with three parameters: | ||
- include.date: the date to be processed | ||
- include.format: the date format. (If empty a default format will be used) | ||
- include.lang: lang to use for translation. | ||
{%- endcomment -%} | ||
|
||
{%- comment -%} | ||
If the parameter date format is empty the default format set in _config.yml is used. | ||
If there is no default in _config, "%b %-d, %Y" is used. | ||
{%- endcomment -%} | ||
{%- assign locales = site.data.locales.date -%} | ||
{%- assign date_format_to_be_translated = include.format | default: site.date_format | default: "%b %-d, %Y" -%} | ||
|
||
{%- comment -%} | ||
Init to have the indice of the day in the week (num_day) and the indice of the month in the year (num_mont) | ||
Init the lang parameter depending if it's set in the include call, in the page or in the site settings | ||
{%- endcomment -%} | ||
|
||
{%- assign num_day = include.date | date: "%w" | plus: 0 -%} | ||
{%- assign num_month = include.date | date: "%-m" | plus: -1 -%} | ||
{%- assign lang = include.lang | default: page.lang | default: site.lang -%} | ||
|
||
{%- comment -%} | ||
Use translated abbreviated weekday if "%a" is used in the format and the translation is available in _data/locales/date.yml | ||
{%- endcomment -%} | ||
|
||
{%- if locales.abbr_weekday[lang][num_day] -%} | ||
{%- assign date_format_to_be_translated = date_format_to_be_translated | replace: "%a", locales.abbr_weekday[lang][num_day] -%} | ||
{%- endif -%} | ||
|
||
{%- comment -%} | ||
Use translated full weekday if "%A" is used in the format and the translation is available in _data/locales/date.yml | ||
{%- endcomment -%} | ||
|
||
{%- if locales.full_weekday[lang][num_day] -%} | ||
{%- assign date_format_to_be_translated = date_format_to_be_translated | replace: "%A", locales.full_weekday[lang][num_day] -%} | ||
{%- endif -%} | ||
|
||
{%- comment -%} | ||
Use translated abbreviated month if "%b" is used in the format and the translation is available in _data/locales/date.yml | ||
{%- endcomment -%} | ||
|
||
{%- if locales.abbr_month[lang][num_month] -%} | ||
{%- assign date_format_to_be_translated = date_format_to_be_translated | replace: "%b", locales.abbr_month[lang][num_month] -%} | ||
{%- endif -%} | ||
|
||
{%- comment -%} | ||
Use translated abbreviated weekday if "%B" is used in the format and the translation is available in _data/locales/date.yml | ||
{%- endcomment -%} | ||
{%- if locales.full_month[lang][num_month] -%} | ||
{%- assign date_format_to_be_translated = date_format_to_be_translated | replace: "%B", locales.full_month[lang][num_month] -%} | ||
{%- endif -%} | ||
{{ include.date | date: date_format_to_be_translated }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters