From 1077e2a84d97f0a23d0f12ea1e9b25823b3b0391 Mon Sep 17 00:00:00 2001 From: Alexandr Borisov Date: Tue, 4 Jul 2017 10:01:53 +0300 Subject: [PATCH 1/5] Fixed typo in ru translation --- source/ru/1.0.0/index.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ru/1.0.0/index.html.haml b/source/ru/1.0.0/index.html.haml index 47b612f..bc14708 100644 --- a/source/ru/1.0.0/index.html.haml +++ b/source/ru/1.0.0/index.html.haml @@ -299,5 +299,5 @@ version: 1.0.0 %h3 Обсуждения %p Я приходил в #{link_to "подкаст The Changelog", thechangelog}, - чтобы поговорить о том, почему мейнтейнеры и контрьбьюторы долны вести логи изменений, + чтобы поговорить о том, почему мейнтейнеры и контрьбьюторы должны вести логи изменений, а также о моей мотивации к созданию этого проекта. From 0d8a45ba3fbcb2531a2838cfe7e126c5871b2019 Mon Sep 17 00:00:00 2001 From: Olivier Lacan Date: Thu, 6 Jul 2017 14:37:15 +0200 Subject: [PATCH 2/5] Say PT-br in PT-br --- config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.rb b/config.rb index d217b5c..c600b0f 100644 --- a/config.rb +++ b/config.rb @@ -49,7 +49,7 @@ $languages = { name: "Polskie" }, "pt-BR" => { - name: "Brazilian Portugese", + name: "Português do Brasil", notice: "A última versão (#{$last_version}) ainda não está disponível em Português mas nesse momento você pode lê-la em inglês e ajudar em sua tradução." From 313a4406c0bd1201fddce7429851ad9992abf0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz?= Date: Thu, 6 Jul 2017 20:21:55 +0100 Subject: [PATCH 3/5] Add content to language selector options Firefox (Gecko engine) do not render the `label` attribute as option content. Resolve #180 More info: https://bugzilla.mozilla.org/show_bug.cgi?id=40545 --- source/layouts/layout.html.haml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/layouts/layout.html.haml b/source/layouts/layout.html.haml index 91b2244..af6027c 100644 --- a/source/layouts/layout.html.haml +++ b/source/layouts/layout.html.haml @@ -50,10 +50,12 @@ - selected = language_code == language.first - if version_exists %option{ selected: selected, label: "#{$last_version} #{language.last[:name]}", value: language.first } + = "#{$last_version} #{language.last[:name]}" - else - previous_version = File.exists?("source/#{language.first}/#{$previous_version}") - if previous_version %option{ selected: selected, label: "#{$previous_version} #{language.last[:name]}", value: language.first } + = "#{$previous_version} #{language.last[:name]}" .main{ role: "main" } - if !latest_version From d17b63709715662be9c510d9201f805bc6db8544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz?= Date: Thu, 6 Jul 2017 20:59:19 +0100 Subject: [PATCH 4/5] Add helper to simplify the build of language selector --- config.rb | 13 +++++++++++++ source/layouts/layout.html.haml | 12 +++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/config.rb b/config.rb index d217b5c..37f7686 100644 --- a/config.rb +++ b/config.rb @@ -154,6 +154,19 @@ helpers do def path_to_url(path) Addressable::URI.join(config.site_url, path).normalize.to_s end + + def available_translation_for(language) + language_name = language.last[:name] + language_path = "source/#{language.first}" + + if File.exists?("#{language_path}/#{$last_version}") + "#{$last_version} #{language_name}" + elsif File.exists?("#{language_path}/#{$previous_version}") + "#{$previous_version} #{language_name}" + else + nil + end + end end # -------------------------------------- diff --git a/source/layouts/layout.html.haml b/source/layouts/layout.html.haml index af6027c..f57b928 100644 --- a/source/layouts/layout.html.haml +++ b/source/layouts/layout.html.haml @@ -46,16 +46,10 @@ %nav.locales{ role: "navigation" } %select - $languages.each do |language| - - version_exists = File.exists?("source/#{language.first}/#{$last_version}") - selected = language_code == language.first - - if version_exists - %option{ selected: selected, label: "#{$last_version} #{language.last[:name]}", value: language.first } - = "#{$last_version} #{language.last[:name]}" - - else - - previous_version = File.exists?("source/#{language.first}/#{$previous_version}") - - if previous_version - %option{ selected: selected, label: "#{$previous_version} #{language.last[:name]}", value: language.first } - = "#{$previous_version} #{language.last[:name]}" + - if available_translation = available_translation_for(language) + %option{ selected: selected, label: available_translation, value: language.first } + = available_translation .main{ role: "main" } - if !latest_version From c81765b3ea684108637a5a2e657e1c7dfa76c679 Mon Sep 17 00:00:00 2001 From: Olivier Lacan Date: Tue, 18 Jul 2017 12:54:17 +0200 Subject: [PATCH 5/5] Address issues with Confusing Dates section This section was by far the weakest since it focused too heavily on issues with the U.S.-based date formats and not enough on justifying the recommendation. Addresses #191 #178 --- source/en/1.0.0/index.html.haml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/en/1.0.0/index.html.haml b/source/en/1.0.0/index.html.haml index 32c7291..3632429 100644 --- a/source/en/1.0.0/index.html.haml +++ b/source/en/1.0.0/index.html.haml @@ -167,13 +167,16 @@ version: 1.0.0 Confusing Dates %p - In the U.S., people put the month first (06-02-2012 for - June 2nd, 2012), while many people in the rest of the world write a - robotic-looking 2 June 2012, yet pronounce it - differently. 2012-06-02 works logically from largest to - smallest, doesn't overlap in ambiguous ways with other date formats, - and is an #{link_to "ISO standard", iso}. Thus, it is the - recommended date format for changelogs. + Regional date formats vary throughout the world and it's often + difficult to find a human-friendly date format that feels intuitive + to everyone. The advantage of dates formatted like + 2017-07-17 is that they follow the order of largest to + smallest units: year, month, and day. This format also doesn't + overlap in ambiguous ways with other date formats, unlike some + regional formats that switch the position of month and day numbers. + These reasons, and the fact this date format is an + #{link_to "ISO standard", iso} are why it is the recommended date + format for changelog entries. %aside There’s more. Help me collect these antipatterns by