Skip to content

Commit eab96ff

Browse files
Dale KunceDale Kunce
authored andcommitted
Remove legacy i18n code and implement Jekyll Polyglot date localization
- Remove i18n_filter.rb plugin and get_locale.html include (no longer needed) - Replace all localize filter usage with Jekyll Polyglot approach - Fix blog post date localization using site.data[site.active_lang].months array - Update month data structure with null placeholder for 1-based indexing - Replace get_locale.html includes with direct locale = site.active_lang assignment - All date localization now works correctly across EN/FR/ES/CS languages - Blog posts and listings display proper localized month names - Mobile menu JavaScript functionality preserved and working
1 parent b587c1b commit eab96ff

28 files changed

Lines changed: 139 additions & 62 deletions

app/.jekyll-metadata

1.31 KB
Binary file not shown.

app/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
id: 404
55
lang: en
66
---
7-
{% include get_locale.html %}
7+
{% assign locale = site.active_lang %}
88
{% include header.html %}
99
{% include 404.html %}

app/_data/cs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,21 @@ lost:
490490
title: "Stránka nenalezena."
491491
message: "To je nepříjemné. Zdá se, že jste někde, kde jsme to ještě nezmapovali."
492492
link: "Pomozte nám zmapovat svět."
493+
494+
#####################
495+
## DATE LOCALIZATION ##
496+
#####################
497+
months:
498+
- null
499+
- Leden
500+
- Únor
501+
- Březen
502+
- Duben
503+
- Květen
504+
- Červen
505+
- Červenec
506+
- Srpen
507+
- Září
508+
- Říjen
509+
- Listopad
510+
- Prosinec

app/_data/en.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,3 +484,21 @@ lost:
484484
title: "This page is missing."
485485
message: "This is kind of embarrassing. You seem to be somewhere that we haven't mapped yet."
486486
link: "Help us map the world."
487+
488+
#####################
489+
## DATE LOCALIZATION ##
490+
#####################
491+
months:
492+
- null
493+
- January
494+
- February
495+
- March
496+
- April
497+
- May
498+
- June
499+
- July
500+
- August
501+
- September
502+
- October
503+
- November
504+
- December

app/_data/es.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,3 +480,21 @@ lost:
480480
title: "Esta página no se encuentra."
481481
message: "Esto es un poco embarazoso. Usted parece estar en un lugar que no hemos asignado todavía."
482482
link: "Nos ayudan a trazar mapas del mundo."
483+
484+
#####################
485+
## DATE LOCALIZATION ##
486+
#####################
487+
months:
488+
- null
489+
- Enero
490+
- Febrero
491+
- Marzo
492+
- Abril
493+
- Mayo
494+
- Junio
495+
- Julio
496+
- Agosto
497+
- Septiembre
498+
- Octubre
499+
- Noviembre
500+
- Diciembre

app/_data/fr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,3 +480,21 @@ lost:
480480
title: "Cette page est manquante."
481481
message: "Esto es un poco embarazoso. Usted parece estar en un lugar que no hemos asignado todavía."
482482
link: "Aidez-nous à cartographier le monde."
483+
484+
#####################
485+
## DATE LOCALIZATION ##
486+
#####################
487+
months:
488+
- null
489+
- Janvier
490+
- Février
491+
- Mars
492+
- Avril
493+
- Mai
494+
- Juin
495+
- Juillet
496+
- Août
497+
- Septembre
498+
- Octobre
499+
- Novembre
500+
- Décembre

app/_includes/blog.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ <h2 class="title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
1717
<a href="{{ post.url }}">
1818
<img class="medium-4 pull-right blog-img stack-for-small" src="{{ post.banner }}" alt="{{ post.title }}" />
1919
</a>
20-
<p><span class="blog-date">{{post.date | localize: "%d",locale }} {{ post.date | localize: "%B",locale }} {{ post.date | localize: "%Y",locale }} </span> &nbsp;|&nbsp; by {{ post.author }}</p>
20+
{% assign month_number = post.date | date: "%-m" | plus: 0 %}
21+
<p><span class="blog-date">{{ post.date | date: "%-d" }} {{ site.data[site.active_lang].months[month_number] }} {{ post.date | date: "%Y" }} </span> &nbsp;|&nbsp; by {{ post.author }}</p>
2122
<p class="medium-7">{{ post.excerpt }}</p>
2223
</div>
2324
{% endif %}

app/_includes/categories.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ <h2 id="{{ this_word | cgi_escape }}">{{ this_word | capitalize}}</h2>
4040
<span style="float: left;">
4141
<a href="{{ post.url }}">{{ post.title }}</a>
4242
</span>
43+
{% assign month_number = post.date | date: "%-m" | plus: 0 %}
4344
<span style="float: right;">
44-
{{ post.date | localize: "%B",locale }} {{ post.date | localize: "%Y",locale }}
45+
{{ site.data[site.active_lang].months[month_number] }} {{ post.date | date: "%Y" }}
4546
</span>
4647
</div>
4748
<div style="clear: both;"></div>

app/_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% include get_locale.html %}
1+
{% assign locale = site.active_lang %}
22
<footer class="site-footer">
33
<div class="wrapper">
44
<div class="footer-container">

app/_includes/get_locale.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)