diff --git a/app/views/dashboards/_dashboard_article_row.html.erb b/app/views/dashboards/_dashboard_article_row.html.erb index da783056e..23cd3fceb 100644 --- a/app/views/dashboards/_dashboard_article_row.html.erb +++ b/app/views/dashboards/_dashboard_article_row.html.erb @@ -24,6 +24,9 @@ <% if article.collection_id %> <%= t("views.dashboard.article.series") %> <%= article.series %> <% end %> + <% if article.language %> + <%= t("views.dashboard.article.language") %> <%= t(article.language, scope: "languages.display_name") %> + <% end %>

<% end %> diff --git a/config/locales/languages/en.yml b/config/locales/languages/en.yml new file mode 100644 index 000000000..85a59368a --- /dev/null +++ b/config/locales/languages/en.yml @@ -0,0 +1,113 @@ +--- +en: + languages: + display_name: + af: Afrikaans + am: Amharic + ar: Arabic + az: Azerbaijani + be: Belarusian + bg: Bulgarian + bg-Latn: Bulgarian (Latin) + bn: Bangla + bs: Bosnian + ca: Catalan + ceb: Cebuano + co: Corsican + cs: Czech + cy: Welsh + da: Danish + de: German + el: Greek + el-Latn: Greek (Latin) + en: English + eo: Esperanto + es: Spanish + et: Estonian + eu: Basque + fa: Persian + fi: Finnish + fil: Filipino + fr: French + fy: Western Frisian + ga: Irish + gd: Scottish Gaelic + gl: Galician + gu: Gujarati + ha: Hausa + haw: Hawaiian + hi: Hindi + hi-Latn: Hindi (Latin) + hmn: Hmong + hr: Croatian + ht: Haitian Creole + hu: Hungarian + hy: Armenian + id: Indonesian + ig: Igbo + is: Icelandic + it: Italian + iw: Hebrew + ja: Japanese + ja-Latn: Japanese (Latin) + jv: Javanese + ka: Georgian + kk: Kazakh + km: Khmer + kn: Kannada + ko: Korean + ku: Kurdish + ky: Kyrgyz + la: Latin + lb: Luxembourgish + lo: Lao + lt: Lithuanian + lv: Latvian + mg: Malagasy + mi: Māori + mk: Macedonian + ml: Malayalam + mn: Mongolian + mr: Marathi + ms: Malay + mt: Maltese + my: Burmese + ne: Nepali + nl: Dutch + no: Norwegian + ny: Nyanja + pa: Punjabi + pl: Polish + ps: Pashto + pt: Portuguese + ro: Romanian + ru: Russian + ru-Latn: Russian (Latin) + sd: Sindhi + si: Sinhala + sk: Slovak + sl: Slovenian + sm: Samoan + sn: Shona + so: Somali + sq: Albanian + sr: Serbian + st: Southern Sotho + su: Sundanese + sv: Swedish + sw: Swahili + ta: Tamil + te: Telugu + tg: Tajik + th: Thai + tr: Turkish + uk: Ukrainian + ur: Urdu + uz: Uzbek + vi: Vietnamese + xh: Xhosa + yi: Yiddish + yo: Yoruba + zh: Chinese + zh-Latn: Chinese (Latin) + zu: Zulu diff --git a/config/locales/languages/fr.yml b/config/locales/languages/fr.yml new file mode 100644 index 000000000..93a35897d --- /dev/null +++ b/config/locales/languages/fr.yml @@ -0,0 +1,113 @@ +--- +fr: + languages: + display_name: + af: Afrikaans + am: Amharic + ar: Arabic + az: Azerbaijani + be: Belarusian + bg: Bulgarian + bg-Latn: Bulgarian (Latin) + bn: Bangla + bs: Bosnian + ca: Catalan + ceb: Cebuano + co: Corsican + cs: Czech + cy: Welsh + da: Danish + de: German + el: Greek + el-Latn: Greek (Latin) + en: English + eo: Esperanto + es: Spanish + et: Estonian + eu: Basque + fa: Persian + fi: Finnish + fil: Filipino + fr: French + fy: Western Frisian + ga: Irish + gd: Scottish Gaelic + gl: Galician + gu: Gujarati + ha: Hausa + haw: Hawaiian + hi: Hindi + hi-Latn: Hindi (Latin) + hmn: Hmong + hr: Croatian + ht: Haitian Creole + hu: Hungarian + hy: Armenian + id: Indonesian + ig: Igbo + is: Icelandic + it: Italian + iw: Hebrew + ja: Japanese + ja-Latn: Japanese (Latin) + jv: Javanese + ka: Georgian + kk: Kazakh + km: Khmer + kn: Kannada + ko: Korean + ku: Kurdish + ky: Kyrgyz + la: Latin + lb: Luxembourgish + lo: Lao + lt: Lithuanian + lv: Latvian + mg: Malagasy + mi: Māori + mk: Macedonian + ml: Malayalam + mn: Mongolian + mr: Marathi + ms: Malay + mt: Maltese + my: Burmese + ne: Nepali + nl: Dutch + no: Norwegian + ny: Nyanja + pa: Punjabi + pl: Polish + ps: Pashto + pt: Portuguese + ro: Romanian + ru: Russian + ru-Latn: Russian (Latin) + sd: Sindhi + si: Sinhala + sk: Slovak + sl: Slovenian + sm: Samoan + sn: Shona + so: Somali + sq: Albanian + sr: Serbian + st: Southern Sotho + su: Sundanese + sv: Swedish + sw: Swahili + ta: Tamil + te: Telugu + tg: Tajik + th: Thai + tr: Turkish + uk: Ukrainian + ur: Urdu + uz: Uzbek + vi: Vietnamese + xh: Xhosa + yi: Yiddish + yo: Yoruba + zh: Chinese + zh-Latn: Chinese (Latin) + zu: Zulu diff --git a/config/locales/views/dashboard/en.yml b/config/locales/views/dashboard/en.yml index cf34639bd..3af1f097a 100644 --- a/config/locales/views/dashboard/en.yml +++ b/config/locales/views/dashboard/en.yml @@ -49,6 +49,7 @@ en: draft: Draft scheduled: Scheduled scheduled_at: 'Scheduled:' + language: 'Language:' reactions: title: Reactions icon: Reactions diff --git a/spec/requests/dashboard_spec.rb b/spec/requests/dashboard_spec.rb index 1f95227a1..9c58a46cf 100644 --- a/spec/requests/dashboard_spec.rb +++ b/spec/requests/dashboard_spec.rb @@ -54,6 +54,14 @@ RSpec.describe "Dashboards" do expect(response.body).to include "Scheduled" end + it "renders the detected language if an article has it" do + article + article.update_column(:language, :es) + get "/dashboard" + expect(response.body).to include "Language:" + expect(response.body).to include "Spanish" + end + it "renders the delete button for scheduled article" do scheduled_article get "/dashboard"