From 38023746a36e7a0e66725b2fdc2d7722fd417c4d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 09:39:48 +1030 Subject: [PATCH 01/31] Add spec for detecting missed translations --- spec/views/i18n_spec.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 spec/views/i18n_spec.rb diff --git a/spec/views/i18n_spec.rb b/spec/views/i18n_spec.rb new file mode 100644 index 0000000000..369668f851 --- /dev/null +++ b/spec/views/i18n_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +require 'rails_helper' +require 'i18n/tasks' + +RSpec.describe I18n do + let(:i18n) { I18n::Tasks::BaseTask.new } + let(:missing_keys) { i18n.missing_keys } + let(:unused_keys) { i18n.unused_keys } + let(:inconsistent_interpolations) { i18n.inconsistent_interpolations } + + it 'does not have missing keys' do + expect(missing_keys).to be_empty, + "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them" + end + + it 'does not have unused keys' do + expect(unused_keys).to be_empty, + "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them" + end + + it 'files are normalized' do + non_normalized = i18n.non_normalized_paths + error_message = "The following files need to be normalized:\n" \ + "#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \ + "Please run `i18n-tasks normalize' to fix" + expect(non_normalized).to be_empty, error_message + end + + it 'does not have inconsistent interpolations' do + error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \ + "Run `i18n-tasks check-consistent-interpolations' to show them" + expect(inconsistent_interpolations).to be_empty, error_message + end +end From c51dd5097c44879a7b5b6b65be69b679545ecfd1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 09:45:59 +1030 Subject: [PATCH 02/31] Translations --- app/views/admin/index.html.haml | 2 +- app/views/crops/_alternate_names.html.haml | 4 ++-- app/views/crops/_scientific_names.html.haml | 4 ++-- config/locales/en.yml | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/admin/index.html.haml b/app/views/admin/index.html.haml index 9a60bb3247..75dda73271 100644 --- a/app/views/admin/index.html.haml +++ b/app/views/admin/index.html.haml @@ -17,7 +17,7 @@ %li= link_to "Roles", admin_roles_path, class: 'nav-link' %li= link_to "Forums", forums_path, class: 'nav-link' %li= link_to "CMS", comfy_admin_cms_path, class: 'nav-link' - %li= link_to t('.garden_types'), garden_types_path, class: 'nav-link' + %li= link_to t('layouts.header.garden_types'), garden_types_path, class: 'nav-link' .col-md-4 .card diff --git a/app/views/crops/_alternate_names.html.haml b/app/views/crops/_alternate_names.html.haml index 04c4314fc8..d4e69e46f9 100644 --- a/app/views/crops/_alternate_names.html.haml +++ b/app/views/crops/_alternate_names.html.haml @@ -10,11 +10,11 @@ - if can? :edit, an = link_to edit_alternate_name_path(an), class: 'dropdown-item' do = edit_icon - = t('.edit') + = t('buttons.edit') - if can? :destroy, an = link_to an, method: :delete, data: { confirm: 'Are you sure?' }, class: 'dropdown-item' do = delete_icon - = t('.delete') + = t('buttons.delete') - else .badge= an.name diff --git a/app/views/crops/_scientific_names.html.haml b/app/views/crops/_scientific_names.html.haml index bf6ace2503..f0895005c3 100644 --- a/app/views/crops/_scientific_names.html.haml +++ b/app/views/crops/_scientific_names.html.haml @@ -10,11 +10,11 @@ .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"} = link_to edit_scientific_name_path(sn), class: 'dropdown-item' do = edit_icon - = t('.edit') + = t('buttons.edit') .dropdown-divider = link_to sn, method: :delete, data: { confirm: 'Are you sure?' }, class: 'dropdown-item text-danger' do = delete_icon - = t('.delete') + = t('buttons.delete') - else .badge= sn.name diff --git a/config/locales/en.yml b/config/locales/en.yml index 0027f36980..5555e17dae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -91,6 +91,7 @@ en: save_seeds: Save seeds timeline: Timeline write_blog_post: Write blog post + plant_something: Plant something crops: search: Search crops index: From e325d7a20e0d241803e1d07019b96747472cf856 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 09:48:30 +1030 Subject: [PATCH 03/31] Skip images. Later, may want to add js checking for any i18n usage there --- config/i18n-tasks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index e1a1c35d95..afa4d7720b 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -47,7 +47,8 @@ search: ## Paths to search in, passed to File.find paths: - - app/ + - app/views/ + - app/controllers/ ## Root for resolving relative keys (default) # relative_roots: From eec7bac77a92fd0a7642d03d3aa910a497fb6065 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 09:52:24 +1030 Subject: [PATCH 04/31] Fix button translations --- app/views/admin/roles/index.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/roles/index.html.haml b/app/views/admin/roles/index.html.haml index eced7a10d4..a8d2f1abd4 100644 --- a/app/views/admin/roles/index.html.haml +++ b/app/views/admin/roles/index.html.haml @@ -23,8 +23,8 @@ - if can? :edit, role = link_to edit_admin_role_path(role), class: 'btn btn-default btn-xs' do = edit_icon - = t('.edit') + = t('buttons.edit') - if can?(:destroy, role) && ! role.members.any? = link_to admin_role_path(role), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-xs text-danger' do = delete_icon - = t('.delete') + = t('buttons.delete') From 9250a179f7be5e7d234f78ba4989410f5a798876 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 09:53:57 +1030 Subject: [PATCH 05/31] Fix buttons --- app/views/crops/_wrangle.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/crops/_wrangle.html.haml b/app/views/crops/_wrangle.html.haml index 6c93c734d2..e8777213df 100644 --- a/app/views/crops/_wrangle.html.haml +++ b/app/views/crops/_wrangle.html.haml @@ -8,7 +8,7 @@ .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-button"} = link_to edit_crop_path(crop), class: 'dropdown-item' do = edit_icon - = t('.edit') + = t('buttons.edit') = link_to crop_openfarm_path(crop), method: :post, class: 'dropdown-item' do = icon 'far', 'update' From 9f470817d73d13e56bc9a4f1f6edf62aafa2d1f5 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 09:55:44 +1030 Subject: [PATCH 06/31] Add missing translations, auto generated. May want to duplicate the core models --- config/locales/en.yml | 134 +++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 74 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5555e17dae..8cce0b61a9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,35 +1,4 @@ --- -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# The following keys must be escaped otherwise they will not be retrieved by -# the default I18n backend: -# -# true, false, on, off, yes, no -# -# Instead, surround them with single quotes. -# -# en: -# 'true': 'foo' -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - en: activerecord: models: @@ -80,20 +49,19 @@ en: mark_as_finished: Mark as finished mark_as_inactive: Mark as inactive my_gardens: My Gardens - new_seeds: New saved seed + new_harvest: New harvest new_planting: New planting new_post: Write new post - new_harvest: New harvest + new_seeds: New saved seed plant: Plant plant_crop: Plant %{crop_name} + plant_something: Plant something plant_something_here: Plant something here record_harvest: Record Harvest save_seeds: Save seeds timeline: Timeline write_blog_post: Write blog post - plant_something: Plant something crops: - search: Search crops index: subtitle: "%{crops_size} total" title: Browse Crops @@ -101,7 +69,13 @@ en: link: You have %{number_crops} crops awaiting approval subtitle: Pending approval title: Requested crops + search: Search crops + date: + abbr_month_names: Abbr month names edit_crop: Edit crop + errors: + messages: + not_saved: Not saved forms: optional: "(Optional)" forums: @@ -132,9 +106,7 @@ en: home: blurb: already_html: Or %{sign_in} if you already have an account - intro: > - %{site_name} is a community of food gardeners. %{site_name}'s open source and open data platform - can predict when your plantings will be ready to harvest. The more you tell it, the better the predictions. + intro: "%{site_name} is a community of food gardeners. %{site_name}'s open source and open data platform can predict when your plantings will be ready to harvest. The more you tell it, the better the predictions.\n" perks: Join now for your free garden journal, harvest predictions, forums, and more. sign_in_linktext: sign in sign_up: Sign up @@ -147,6 +119,9 @@ en: discussion: Discussion forums: Forums view_all: View all posts + harvests: + recently_harvested: Recently Harvested + view_all: View all harvests index: add_seeds: Add seeds edit_profile: Edit profile @@ -155,8 +130,6 @@ en: post: Post recently_added: Recently Added welcome: Welcome to %{site_name}, %{member_name} - harvests: - view_all: View all harvests members: title: Some of our members view_all: View all members @@ -164,23 +137,17 @@ en: ad_free_linktext: ad-free api_docs_linktext: API documentation creative_commons_linktext: Creative Commons license - get_involved_body_html: > - We believe in collaboration, and work closely with our members and the wider food-growing community. - Our team includes volunteers from all walks of life and all skill levels. To get involved, - visit %{talk_link} or find more information on the %{wiki_link}. + get_involved_body_html: 'We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. + + ' get_involved_title: Get Involved github_linktext: Github - open_data_body_html: > - We're building a database of crops, planting advice, seed sources, and other information that anyone - can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, - or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + open_data_body_html: 'We''re building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + + ' open_data_title: Open Data and APIs - open_source_body_html: > - %{site_name} is open source software, which means that we share this website's code for free with our - community and the world. We believe that openness, sustainability, and social good go hand in hand. - You can read more about %{why} or check out our code on %{github}. + open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}.\n" open_source_title: Open Source - support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. support_title: Support Growstuff talk_linktext: Growstuff Talk @@ -206,13 +173,15 @@ en: number_gardens_linktext: "%{count} gardens" number_plantings_linktext: "%{count} times" label: - days_until_harvest: "%{number} days" - weeks_until_harvest: "%{number} weeks until harvest" + data: 'The data on this page is available in the following formats:' days_until_finished: "%{number} days" - weeks_until_finished: "%{number} weeks" + days_until_harvest: "%{number} days" harvesting_now: harvesting now - data: 'The data on this page is available in the following formats:' + weeks_until_finished: "%{number} weeks" + weeks_until_harvest: "%{number} weeks until harvest" layouts: + application: + skip: Skip header: account: Account admin: Admin @@ -220,33 +189,49 @@ en: browse_members: Browse Members community: Community community_map: Community Map - garden_type: Garden Type - garden_types: Garden Types crop_wrangling: Crop Wrangling crops: Crops current_memberlogin_name: "%{current_memberlogin_name}" forums: Forums + garden_type: Garden Type + garden_types: Garden Types gardens: Gardens harvest: Harvest harvests: Harvests - record: Record inbox: Inbox inbox_unread: Inbox (%{unread_count}) plantings: Plantings posts: Posts profile: Profile + record: Record seeds: Seeds skip: Skip navigation menu support_growstuff: Support Growstuff toggle_navigation: Toggle Navigation your_stuff: Your Stuff menu: + admin: Admin + browse_crops: Browse crops + browse_members: Browse members + community: Community + community_map: Community map + crop_wrangling: Crop wrangling + crops: Crops + forums: Forums + gardens: Gardens + harvest: Harvest + harvests: Harvests + inbox: Inbox + plantings: Plantings + posts: Posts + profile: Profile + record: Record + seeds: Seeds sign_in: Sign in sign_out: Sign out sign_up: Sign up links: my_gardens: My gardens - members: edit_profile: Edit profile index: @@ -285,34 +270,34 @@ en: late_finishing: late finishing sharedbuttonsfinish_planting: shared/buttons/finish_planting super_late: super late - plant_something: Plant something form: - finish_helper: > - A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise - no longer growing in your garden. + finish_helper: 'A planting is finished when you''ve harvested all of the crop, or it dies, or it''s otherwise no longer growing in your garden. + + ' index: title: crop_plantings: Everyone's %{crop} plantings default: Everyone's plantings owner_plantings: "%{owner}'s plantings" view_owners_profile: View %{owner}'s profile >> - string: "%{crop} planting in %{garden} by %{owner}" + plant_something: Plant something progress: progress_0_not_planted_yet: 'Progress: 0% - not planted yet' + string: "%{crop} planting in %{garden} by %{owner}" posts: - write_blog_post: Write blog post index: title: author_posts: "%{author} posts" default: Everyone's posts + write_blog_post: Write blog post seeds: form: - trade_help: > - Are you interested in trading or swapping seeds with other %{site_name} members? If you list - your seeds as available for trade, other members can contact you to request seeds. You can - list any conditions or other information in the description, above. - finish_helper: > - Seeds are finished when you've planted them all, or you've traded them all away. + finish_helper: 'Seeds are finished when you''ve planted them all, or you''ve traded them all away. + + ' + trade_help: 'Are you interested in trading or swapping seeds with other %{site_name} members? If you list your seeds as available for trade, other members can contact you to request seeds. You can list any conditions or other information in the description, above. + + ' index: title: crop_seeds: Everyone's %{crop} seeds @@ -323,12 +308,13 @@ en: unauthorized: create: all: Please sign in or sign up to create a %{subject}. + garden_type: Not authorized. Only admins can create garden types. notification: Please sign in to send a message. planting: Please sign in or sign up to plant something. post: Please sign in or sign up to post. seed: Please sign in or sign up to add seeds. - garden_type: Not authorized. Only admins can create garden types. manage: all: Not authorized to %{action} %{subject}. read: notification: You must be signed in to view notifications. + view: View From 5370dc990171ac23f77f1819bc678003f77037e0 Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Fri, 9 Dec 2022 23:27:55 +0000 Subject: [PATCH 07/31] [CodeFactor] Apply fixes --- spec/views/i18n_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/views/i18n_spec.rb b/spec/views/i18n_spec.rb index 369668f851..5b9696ba02 100644 --- a/spec/views/i18n_spec.rb +++ b/spec/views/i18n_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' require 'i18n/tasks' From 974a1019f799041d549923b5616d9fe612a2edd4 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:01:56 +1030 Subject: [PATCH 08/31] Update en.yml --- config/locales/en.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8cce0b61a9..28fe2e21f7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -106,7 +106,9 @@ en: home: blurb: already_html: Or %{sign_in} if you already have an account - intro: "%{site_name} is a community of food gardeners. %{site_name}'s open source and open data platform can predict when your plantings will be ready to harvest. The more you tell it, the better the predictions.\n" + intro: > + %{site_name} is a community of food gardeners. %{site_name}'s open source and open data platform + can predict when your plantings will be ready to harvest. The more you tell it, the better the predictions. perks: Join now for your free garden journal, harvest predictions, forums, and more. sign_in_linktext: sign in sign_up: Sign up From d1b25ef8096625492588eb171688391e9a40382b Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:03:17 +1030 Subject: [PATCH 09/31] Update config/locales/en.yml --- config/locales/en.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 28fe2e21f7..8587678df0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -144,7 +144,10 @@ en: ' get_involved_title: Get Involved github_linktext: Github - open_data_body_html: 'We''re building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. + open_data_body_html: > + We're building a database of crops, planting advice, seed sources, and other information that anyone + can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, + or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. ' open_data_title: Open Data and APIs From 6e36525a62d2c51e1b0511545cb75da015029248 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:03:31 +1030 Subject: [PATCH 10/31] Update config/locales/en.yml --- config/locales/en.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8587678df0..09ca6de961 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -139,7 +139,10 @@ en: ad_free_linktext: ad-free api_docs_linktext: API documentation creative_commons_linktext: Creative Commons license - get_involved_body_html: 'We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. + get_involved_body_html: > + We believe in collaboration, and work closely with our members and the wider food-growing community. + Our team includes volunteers from all walks of life and all skill levels. To get involved, + visit %{talk_link} or find more information on the %{wiki_link}. ' get_involved_title: Get Involved From 6719024c70ab16b3ce71f3b4e75fda9ddd52ccf0 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:05:49 +1030 Subject: [PATCH 11/31] Update en.yml --- config/locales/en.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 09ca6de961..0fce83b61f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -143,18 +143,16 @@ en: We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}. - - ' get_involved_title: Get Involved github_linktext: Github open_data_body_html: > We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. - - ' open_data_title: Open Data and APIs - open_source_body_html: "%{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}.\n" + open_source_body_html > + %{site_name} is open source software, which means that we share this website's code for free with our community and the world. + We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}. open_source_title: Open Source support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. support_title: Support Growstuff @@ -279,9 +277,9 @@ en: sharedbuttonsfinish_planting: shared/buttons/finish_planting super_late: super late form: - finish_helper: 'A planting is finished when you''ve harvested all of the crop, or it dies, or it''s otherwise no longer growing in your garden. - - ' + finish_helper: > + A planting is finished when you've harvested all of the crop, or it dies, + or it's otherwise no longer growing in your garden. index: title: crop_plantings: Everyone's %{crop} plantings @@ -300,12 +298,12 @@ en: write_blog_post: Write blog post seeds: form: - finish_helper: 'Seeds are finished when you''ve planted them all, or you''ve traded them all away. - - ' - trade_help: 'Are you interested in trading or swapping seeds with other %{site_name} members? If you list your seeds as available for trade, other members can contact you to request seeds. You can list any conditions or other information in the description, above. - - ' + finish_helper: > + Seeds are finished when you've planted them all, or you've traded them all away. + trade_help: > + Are you interested in trading or swapping seeds with other %{site_name} members? + If you list your seeds as available for trade, other members can contact you to request seeds. + You can list any conditions or other information in the description, above. index: title: crop_seeds: Everyone's %{crop} seeds From a14cc807aeeec4da919e24f9ffa83f390b1ec7e0 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:10:37 +1030 Subject: [PATCH 12/31] Add rails-i18n --- Gemfile | 1 + Gemfile.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 03576d364f..b34a62e688 100644 --- a/Gemfile +++ b/Gemfile @@ -129,6 +129,7 @@ gem 'faraday' gem 'faraday_middleware' gem 'rack-cors' +gem 'rails-i18n' group :production do gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku diff --git a/Gemfile.lock b/Gemfile.lock index bddcd7ac46..68b6dbc8fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -726,6 +726,7 @@ DEPENDENCIES rails (~> 7.0.4) rails-assets-leaflet.markercluster! rails-controller-testing + rails-i18n rails_12factor rake (>= 10.0.0) responders From 70726e7e52eee04b0c63651f05059c354bd7f513 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:13:52 +1030 Subject: [PATCH 13/31] Fix translations --- config/locales/en.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 0fce83b61f..eaf0479167 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -71,7 +71,19 @@ en: title: Requested crops search: Search crops date: - abbr_month_names: Abbr month names + abbr_month_names: + - Jan + - Feb + - Mar + - Apr + - May + - Jun + - Jul + - Aug + - Sep + - Oct + - Nov + - Dec edit_crop: Edit crop errors: messages: @@ -150,7 +162,7 @@ en: can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. open_data_title: Open Data and APIs - open_source_body_html > + open_source_body_html: > %{site_name} is open source software, which means that we share this website's code for free with our community and the world. We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}. open_source_title: Open Source From 03c65ad187d0d1c0ec3239c813d985a761530b45 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 10:16:10 +1030 Subject: [PATCH 14/31] Codefactor --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index eaf0479167..4deb32ec2d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -290,7 +290,7 @@ en: super_late: super late form: finish_helper: > - A planting is finished when you've harvested all of the crop, or it dies, + A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise no longer growing in your garden. index: title: From 54169fe9ac4f8f1b1bb92ada8f66f0dd2157826b Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:01:13 +1030 Subject: [PATCH 15/31] Adjust translates --- app/views/layouts/_menu.haml | 44 ++++++++++++++++++------------------ config/locales/en.yml | 17 -------------- 2 files changed, 22 insertions(+), 39 deletions(-) diff --git a/app/views/layouts/_menu.haml b/app/views/layouts/_menu.haml index fba2e4aeaa..7be57f7a09 100644 --- a/app/views/layouts/_menu.haml +++ b/app/views/layouts/_menu.haml @@ -10,7 +10,7 @@ %li.nav-item.dropdown %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"} = image_tag "icons/gardener.svg", class: 'img img-icon' - = t('.record') + = t('layouts.header.record') .dropdown-menu = link_to new_planting_path, class: 'dropdown-item' do = image_icon('planting-add') @@ -27,36 +27,36 @@ - cache("everyone-menu", expires_in: 1.week) do %li.nav-item.dropdown - %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('.crops') + %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('activerecord.models.crop.other').titleize .dropdown-menu = link_to crops_path, class: 'dropdown-item' do - = t('.browse_crops') + = t('layouts.header.browse_crops') = link_to seeds_path, class: 'dropdown-item' do = seed_icon - = t('.seeds') + = t('layouts.header.seeds') = link_to plantings_path, class: 'dropdown-item' do = planting_icon - = t('.plantings') + = t('layouts.header.plantings') = link_to harvests_path, class: 'dropdown-item' do = harvest_icon - = t('.harvests') + = t('layouts.header.harvests') %li.nav-item.dropdown - %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('.community') + %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('layouts.header.community') .dropdown-menu{"aria-labelledby" => "navbarDropdown"} - = link_to t('.community_map'), places_path, class: 'dropdown-item' - = link_to t('.browse_members'), members_path, class: 'dropdown-item' - = link_to t('.posts'), posts_path, class: 'dropdown-item' - = link_to t('.forums'), forums_path, class: 'dropdown-item' + = link_to t('layouts.header.community_map'), places_path, class: 'dropdown-item' + = link_to t('layouts.header.browse_members'), members_path, class: 'dropdown-item' + = link_to t('activerecord.models.post.other').titlize, posts_path, class: 'dropdown-item' + = link_to t('layouts.header.forums'), forums_path, class: 'dropdown-item' - if member_signed_in? - if current_member.role?(:crop_wrangler) || current_member.role?(:admin) %li.nav-item.dropdown - %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('.admin') + %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('layouts.header.admin') .dropdown-menu{"aria-labelledby" => "navbarDropdown"} - if current_member.role?(:crop_wrangler) - = link_to t('.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item' + = link_to t('layouts.header.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item' - if current_member.role?(:admin) - = link_to t('.admin'), admin_path, class: 'dropdown-item' + = link_to t('layouts.header.admin'), admin_path, class: 'dropdown-item' %li.nav-item.dropdown %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"} @@ -66,25 +66,25 @@ %span.badge.badge-info= current_member.unread_count .dropdown-menu{"aria-labelledby" => "navbarDropdown"} = link_to member_path(current_member), class: 'dropdown-item' do - = t('.profile') + = t('layouts.header.profile') = link_to member_gardens_path(current_member), class: 'dropdown-item' do - = t('.gardens') + = t('activerecord.models.garden.other').titleize = link_to member_plantings_path(current_member), class: 'dropdown-item' do - = t('.plantings') + = t('activerecord.models.planting.other').titleize = link_to member_harvests_path(current_member), class: 'dropdown-item' do - = t('.harvest') + = t('activerecord.models.harvest.other').titleize = link_to member_seeds_path(current_member), class: 'dropdown-item' do - = t('.seeds') - = link_to t('.posts'), member_posts_path(current_member), class: 'dropdown-item' + = t('activerecord.models.seed.other').titleize + = link_to t('activerecord.models.post.other').titleize, member_posts_path(current_member), class: 'dropdown-item' - if current_member.unread_count.positive? .dropdown-divider %strong = link_to(conversations_path, class: 'dropdown-item') do - = t('.inbox') + = t('layouts.header.inbox') %span.badge.badge-info= current_member.unread_count - else - = link_to t('.inbox'), conversations_path, class: 'dropdown-item' + = link_to t('layouts.header.inbox'), conversations_path, class: 'dropdown-item' .dropdown-divider = link_to t('.sign_out'), destroy_member_session_path, method: :delete, class: 'dropdown-item' diff --git a/config/locales/en.yml b/config/locales/en.yml index 4deb32ec2d..cd1390cadf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -228,23 +228,6 @@ en: toggle_navigation: Toggle Navigation your_stuff: Your Stuff menu: - admin: Admin - browse_crops: Browse crops - browse_members: Browse members - community: Community - community_map: Community map - crop_wrangling: Crop wrangling - crops: Crops - forums: Forums - gardens: Gardens - harvest: Harvest - harvests: Harvests - inbox: Inbox - plantings: Plantings - posts: Posts - profile: Profile - record: Record - seeds: Seeds sign_in: Sign in sign_out: Sign out sign_up: Sign up From 8512a19bb936c3fd945e27bbf4614cb06f706748 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:12:45 +1030 Subject: [PATCH 16/31] Remove unused keys --- config/locales/en.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index cd1390cadf..793f4b78f0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -151,21 +151,7 @@ en: ad_free_linktext: ad-free api_docs_linktext: API documentation creative_commons_linktext: Creative Commons license - get_involved_body_html: > - We believe in collaboration, and work closely with our members and the wider food-growing community. - Our team includes volunteers from all walks of life and all skill levels. To get involved, - visit %{talk_link} or find more information on the %{wiki_link}. - get_involved_title: Get Involved github_linktext: Github - open_data_body_html: > - We're building a database of crops, planting advice, seed sources, and other information that anyone - can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, - or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}. - open_data_title: Open Data and APIs - open_source_body_html: > - %{site_name} is open source software, which means that we share this website's code for free with our community and the world. - We believe that openness, sustainability, and social good go hand in hand. You can read more about %{why} or check out our code on %{github}. - open_source_title: Open Source support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. support_title: Support Growstuff talk_linktext: Growstuff Talk From 1e30aa7db50494533255ea72e75cb0395e13c1e3 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:15:08 +1030 Subject: [PATCH 17/31] Remove old keys --- config/locales/en.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 793f4b78f0..5fea672289 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -178,8 +178,6 @@ en: number_plantings_linktext: "%{count} times" label: data: 'The data on this page is available in the following formats:' - days_until_finished: "%{number} days" - days_until_harvest: "%{number} days" harvesting_now: harvesting now weeks_until_finished: "%{number} weeks" weeks_until_harvest: "%{number} weeks until harvest" @@ -187,20 +185,14 @@ en: application: skip: Skip header: - account: Account admin: Admin browse_crops: Browse Crops browse_members: Browse Members community: Community community_map: Community Map crop_wrangling: Crop Wrangling - crops: Crops current_memberlogin_name: "%{current_memberlogin_name}" forums: Forums - garden_type: Garden Type - garden_types: Garden Types - gardens: Gardens - harvest: Harvest harvests: Harvests inbox: Inbox inbox_unread: Inbox (%{unread_count}) From fa15889d08a29c1324d24efffd5dc390ecd37189 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:17:07 +1030 Subject: [PATCH 18/31] Disable normalisation test for now --- spec/views/i18n_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/views/i18n_spec.rb b/spec/views/i18n_spec.rb index 5b9696ba02..dd2f0c088b 100644 --- a/spec/views/i18n_spec.rb +++ b/spec/views/i18n_spec.rb @@ -19,7 +19,7 @@ "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them" end - it 'files are normalized' do + xit 'files are normalized' do non_normalized = i18n.non_normalized_paths error_message = "The following files need to be normalized:\n" \ "#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \ From d0185c47fdce0bcd942495b5582f9707d3a94e9f Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:19:00 +1030 Subject: [PATCH 19/31] Remove dead translations --- config/locales/en.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5fea672289..47b5ecbe71 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -209,8 +209,6 @@ en: sign_in: Sign in sign_out: Sign out sign_up: Sign up - links: - my_gardens: My gardens members: edit_profile: Edit profile index: @@ -227,7 +225,6 @@ en: harvest: "%{crop} harvest by %{owner}" planting: "%{planting}" seed: "%{seed}" - thing_by: A %{thing} by %{owner} places: index: title: "%{site_name} Community Map" From 9265cad7697d01150a091116823a9ee15d432e59 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:22:00 +1030 Subject: [PATCH 20/31] Remove more unused translations --- config/locales/en.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 47b5ecbe71..d3045675cc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -195,13 +195,11 @@ en: forums: Forums harvests: Harvests inbox: Inbox - inbox_unread: Inbox (%{unread_count}) plantings: Plantings posts: Posts profile: Profile record: Record seeds: Seeds - skip: Skip navigation menu support_growstuff: Support Growstuff toggle_navigation: Toggle Navigation your_stuff: Your Stuff @@ -276,21 +274,7 @@ en: You can list any conditions or other information in the description, above. index: title: - crop_seeds: Everyone's %{crop} seeds default: Everyone's seeds - owner_seeds: "%{owner} seeds" save_seeds: Save seeds string: "%{crop} seeds belonging to %{owner}" - unauthorized: - create: - all: Please sign in or sign up to create a %{subject}. - garden_type: Not authorized. Only admins can create garden types. - notification: Please sign in to send a message. - planting: Please sign in or sign up to plant something. - post: Please sign in or sign up to post. - seed: Please sign in or sign up to add seeds. - manage: - all: Not authorized to %{action} %{subject}. - read: - notification: You must be signed in to view notifications. view: View From ef427a7971c6b7f63bb8f131df9a36364f828769 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:27:11 +1030 Subject: [PATCH 21/31] Remove more unused --- config/locales/en.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index d3045675cc..5e52f2b4bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -137,26 +137,11 @@ en: recently_harvested: Recently Harvested view_all: View all harvests index: - add_seeds: Add seeds - edit_profile: Edit profile - harvest: Harvest - plant: Plant - post: Post recently_added: Recently Added welcome: Welcome to %{site_name}, %{member_name} members: title: Some of our members view_all: View all members - open: - ad_free_linktext: ad-free - api_docs_linktext: API documentation - creative_commons_linktext: Creative Commons license - github_linktext: Github - support_body_html: Growstuff is independent, %{ad_free} and we have no outside investment. You can support our work by %{buy_account}. - support_title: Support Growstuff - talk_linktext: Growstuff Talk - why_linktext: why Growstuff is open source - wiki_linktext: Growstuff Wiki plantings: recently_planted: Recently Planted view_all: View all plantings @@ -167,8 +152,6 @@ en: from: From location owner: Owner title: Seeds available to trade - trade_to: Will trade to - unspecified: unspecified view_all: View all seeds stats: member_linktext: "%{count} members" @@ -179,7 +162,6 @@ en: label: data: 'The data on this page is available in the following formats:' harvesting_now: harvesting now - weeks_until_finished: "%{number} weeks" weeks_until_harvest: "%{number} weeks until harvest" layouts: application: @@ -202,7 +184,6 @@ en: seeds: Seeds support_growstuff: Support Growstuff toggle_navigation: Toggle Navigation - your_stuff: Your Stuff menu: sign_in: Sign in sign_out: Sign out @@ -238,9 +219,6 @@ en: unknown: Unknown plantings: badges: - days_until_finished: days until finished - days_until_harvest: days until harvest - harvesting_now: harvesting now late_finishing: late finishing sharedbuttonsfinish_planting: shared/buttons/finish_planting super_late: super late @@ -272,9 +250,5 @@ en: Are you interested in trading or swapping seeds with other %{site_name} members? If you list your seeds as available for trade, other members can contact you to request seeds. You can list any conditions or other information in the description, above. - index: - title: - default: Everyone's seeds save_seeds: Save seeds - string: "%{crop} seeds belonging to %{owner}" view: View From a839d68e85665139da31cbf63be835f24928c03a Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:31:10 +1030 Subject: [PATCH 22/31] Remove more unused --- config/locales/en.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5e52f2b4bc..7e1a866164 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -38,28 +38,20 @@ en: default: Default are_you_sure: Are you sure? buttons: - add: Add add_photo: Add photo - add_seed_to_stash: Add %{crop_name} seeds to stash delete: Delete edit: Edit harvest: Harvest harvest_crop: Harvest %{crop_name} mark_as_active: Mark as active - mark_as_finished: Mark as finished mark_as_inactive: Mark as inactive my_gardens: My Gardens new_harvest: New harvest new_planting: New planting new_post: Write new post new_seeds: New saved seed - plant: Plant - plant_crop: Plant %{crop_name} - plant_something: Plant something - plant_something_here: Plant something here record_harvest: Record Harvest save_seeds: Save seeds - timeline: Timeline write_blog_post: Write blog post crops: index: @@ -126,8 +118,6 @@ en: sign_up: Sign up crops: our_crops: Some of our crops - recently_added: Recently added crops - recently_planted: Recently Planted view_all: View all crops discuss: discussion: Discussion @@ -146,11 +136,6 @@ en: recently_planted: Recently Planted view_all: View all plantings seeds: - crop: Crop - description: Description - details: Details - from: From location - owner: Owner title: Seeds available to trade view_all: View all seeds stats: @@ -207,16 +192,6 @@ en: places: index: title: "%{site_name} Community Map" - planting: - status: - finished: Finished - growing: Growing - harvesting: Harvesting - late: Late - not planted: Not planted - not_enough_data: Not enough data - perennial: Perennial - unknown: Unknown plantings: badges: late_finishing: late finishing From 7598f84cea077c9501772d1001d16c45c2d45044 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:33:19 +1030 Subject: [PATCH 23/31] Remove unused --- config/locales/en.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 7e1a866164..f9ff2381e7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -163,11 +163,9 @@ en: harvests: Harvests inbox: Inbox plantings: Plantings - posts: Posts profile: Profile record: Record seeds: Seeds - support_growstuff: Support Growstuff toggle_navigation: Toggle Navigation menu: sign_in: Sign in @@ -201,16 +199,7 @@ en: finish_helper: > A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise no longer growing in your garden. - index: - title: - crop_plantings: Everyone's %{crop} plantings - default: Everyone's plantings - owner_plantings: "%{owner}'s plantings" - view_owners_profile: View %{owner}'s profile >> plant_something: Plant something - progress: - progress_0_not_planted_yet: 'Progress: 0% - not planted yet' - string: "%{crop} planting in %{garden} by %{owner}" posts: index: title: From 60a9d546552908893bd71ef65219de15f068db7c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:33:33 +1030 Subject: [PATCH 24/31] Remove unused --- config/locales/en.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index f9ff2381e7..21960ff3e4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -166,7 +166,6 @@ en: profile: Profile record: Record seeds: Seeds - toggle_navigation: Toggle Navigation menu: sign_in: Sign in sign_out: Sign out From 2853f7232ed4ca0c2ff042744a1cacf8e2ef22f1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:34:59 +1030 Subject: [PATCH 25/31] Remove unused --- config/locales/en.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 21960ff3e4..e4ebb992c7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -92,21 +92,11 @@ en: location_helper: If you have a location set in your profile, it will be used when you create a new garden. location: "%{owner}'s %{garden}" overview: - gardensactions: gardens/actions - gardensphoto: gardens/photo no_plantings: no plantings plantingsthumbnail: plantings/thumbnail updated: Garden was successfully updated. harvests: - created: Harvest was successfully created. harvest_something: Harvest something - index: - title: - crop_harvests: Everyone's %{crop} harvests - default: Everyone's harvests - owner_harvests: "%{owner}'s harvests" - planting_harvests: Harvests from %{planting} - updated: Harvest was successfully updated. home: blurb: already_html: Or %{sign_in} if you already have an account From 051bfd5565239f268ca04b31c66faba51df46363 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:39:17 +1030 Subject: [PATCH 26/31] Remove unused keys --- config/locales/en.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index e4ebb992c7..4711bf695d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -41,27 +41,17 @@ en: add_photo: Add photo delete: Delete edit: Edit - harvest: Harvest - harvest_crop: Harvest %{crop_name} - mark_as_active: Mark as active - mark_as_inactive: Mark as inactive - my_gardens: My Gardens new_harvest: New harvest new_planting: New planting new_post: Write new post new_seeds: New saved seed - record_harvest: Record Harvest save_seeds: Save seeds - write_blog_post: Write blog post crops: index: - subtitle: "%{crops_size} total" title: Browse Crops requested: - link: You have %{number_crops} crops awaiting approval subtitle: Pending approval title: Requested crops - search: Search crops date: abbr_month_names: - Jan @@ -76,12 +66,9 @@ en: - Oct - Nov - Dec - edit_crop: Edit crop errors: messages: not_saved: Not saved - forms: - optional: "(Optional)" forums: index: title: Forums @@ -90,10 +77,6 @@ en: deleted: Garden was successfully deleted. form: location_helper: If you have a location set in your profile, it will be used when you create a new garden. - location: "%{owner}'s %{garden}" - overview: - no_plantings: no plantings - plantingsthumbnail: plantings/thumbnail updated: Garden was successfully updated. harvests: harvest_something: Harvest something @@ -110,8 +93,6 @@ en: our_crops: Some of our crops view_all: View all crops discuss: - discussion: Discussion - forums: Forums view_all: View all posts harvests: recently_harvested: Recently Harvested @@ -148,8 +129,8 @@ en: community: Community community_map: Community Map crop_wrangling: Crop Wrangling - current_memberlogin_name: "%{current_memberlogin_name}" forums: Forums + garden_types: Garden Types harvests: Harvests inbox: Inbox plantings: Plantings From 497f14c1c05300f7013146505de2f72a3d4f3fc2 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:40:15 +1030 Subject: [PATCH 27/31] Remove unused keys --- config/locales/en.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 4711bf695d..34408013b6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -32,10 +32,6 @@ en: seed: one: seed other: seeds - application_helper: - title: - title: - default: Default are_you_sure: Are you sure? buttons: add_photo: Add photo @@ -163,7 +159,6 @@ en: plantings: badges: late_finishing: late finishing - sharedbuttonsfinish_planting: shared/buttons/finish_planting super_late: super late form: finish_helper: > From fbd840686d6de384043f369187748303102f5ddc Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:48:06 +1030 Subject: [PATCH 28/31] Remove model singular forms, we don't use them --- config/locales/en.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 34408013b6..75ee312d8a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,34 +3,24 @@ en: activerecord: models: comment: - one: comment other: comments crop: - one: crop other: crops follow: - one: follow other: follows garden: - one: garden other: gardens harvest: - one: harvest other: harvests member: - one: member other: members photo: - one: photo other: photos planting: - one: planting other: plantings post: - one: post other: posts seed: - one: seed other: seeds are_you_sure: Are you sure? buttons: From 8934e306030cb58f6a079c1afee5be762ef35082 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 14:55:10 +1030 Subject: [PATCH 29/31] Remove japanese local, as it is largely untranslated --- config/locales/ja.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 config/locales/ja.yml diff --git a/config/locales/ja.yml b/config/locales/ja.yml deleted file mode 100644 index 2a51c32c5a..0000000000 --- a/config/locales/ja.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -ja: - home: - blurb: - intro: "%{site_name}はガーデナーのコミュニティです。" From ca9241685ff2916d238e6e9940a20a914d023d99 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 15:20:31 +1030 Subject: [PATCH 30/31] Update app/views/layouts/_menu.haml --- app/views/layouts/_menu.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_menu.haml b/app/views/layouts/_menu.haml index 7be57f7a09..2d7dd3733b 100644 --- a/app/views/layouts/_menu.haml +++ b/app/views/layouts/_menu.haml @@ -45,7 +45,7 @@ .dropdown-menu{"aria-labelledby" => "navbarDropdown"} = link_to t('layouts.header.community_map'), places_path, class: 'dropdown-item' = link_to t('layouts.header.browse_members'), members_path, class: 'dropdown-item' - = link_to t('activerecord.models.post.other').titlize, posts_path, class: 'dropdown-item' + = link_to t('activerecord.models.post.other').titleize, posts_path, class: 'dropdown-item' = link_to t('layouts.header.forums'), forums_path, class: 'dropdown-item' - if member_signed_in? From 177ca58301602a463a459a2071091b7334de262a Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 10 Dec 2022 16:27:25 +1030 Subject: [PATCH 31/31] Drop pointless translations --- app/views/layouts/_menu.haml | 14 +++++++------- config/locales/en.yml | 22 ---------------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/app/views/layouts/_menu.haml b/app/views/layouts/_menu.haml index 2d7dd3733b..172697ffd7 100644 --- a/app/views/layouts/_menu.haml +++ b/app/views/layouts/_menu.haml @@ -27,7 +27,7 @@ - cache("everyone-menu", expires_in: 1.week) do %li.nav-item.dropdown - %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('activerecord.models.crop.other').titleize + %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= Crop.model_name.human(count: 2).titleize .dropdown-menu = link_to crops_path, class: 'dropdown-item' do = t('layouts.header.browse_crops') @@ -45,7 +45,7 @@ .dropdown-menu{"aria-labelledby" => "navbarDropdown"} = link_to t('layouts.header.community_map'), places_path, class: 'dropdown-item' = link_to t('layouts.header.browse_members'), members_path, class: 'dropdown-item' - = link_to t('activerecord.models.post.other').titleize, posts_path, class: 'dropdown-item' + = link_to Post.model_name.human(count: 2).titleize, posts_path, class: 'dropdown-item' = link_to t('layouts.header.forums'), forums_path, class: 'dropdown-item' - if member_signed_in? @@ -68,14 +68,14 @@ = link_to member_path(current_member), class: 'dropdown-item' do = t('layouts.header.profile') = link_to member_gardens_path(current_member), class: 'dropdown-item' do - = t('activerecord.models.garden.other').titleize + = Garden.model_name.human(count: 2).titleize = link_to member_plantings_path(current_member), class: 'dropdown-item' do - = t('activerecord.models.planting.other').titleize + = Planting.model_name.human(count: 2).titleize = link_to member_harvests_path(current_member), class: 'dropdown-item' do - = t('activerecord.models.harvest.other').titleize + = Harvest.model_name.human(count: 2).titleize = link_to member_seeds_path(current_member), class: 'dropdown-item' do - = t('activerecord.models.seed.other').titleize - = link_to t('activerecord.models.post.other').titleize, member_posts_path(current_member), class: 'dropdown-item' + = Seed.model_name.human(count: 2).titleize + = link_to Post.model_name.human(count: 2).titleize, member_posts_path(current_member), class: 'dropdown-item' - if current_member.unread_count.positive? .dropdown-divider diff --git a/config/locales/en.yml b/config/locales/en.yml index 75ee312d8a..8fe9e7df96 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,27 +1,5 @@ --- en: - activerecord: - models: - comment: - other: comments - crop: - other: crops - follow: - other: follows - garden: - other: gardens - harvest: - other: harvests - member: - other: members - photo: - other: photos - planting: - other: plantings - post: - other: posts - seed: - other: seeds are_you_sure: Are you sure? buttons: add_photo: Add photo