Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rails] Let's make it possible to set the available i18n languages per community #950

Open
10 tasks
rudokemper opened this issue Sep 23, 2023 · 0 comments
Open
10 tasks
Labels
Hacktoberfest Hacktoberfest 2023 rails

Comments

@rudokemper
Copy link
Member

Currently, when you open Terrastories, there are a defined number of i18n languages that show up. The way this currently works is that in application.rb there is some code that automatically loads in whatever languages are defined in config/locales/. This has worked for now, but will get unsustainable as more languages get added to Terrastories.

Let's make the following happen:

  1. Specify a default set of languages that show up for a non-logged in user.
  2. Allow community administrators to set which languages they want to show for their community when logged in, and the default selected language for their community.

See acceptance criteria below.

Acceptance criteria:

  • For a non-logged in user loading the Terrastories welcome page, instead of populating all of the languages in config/locales into the language picker, let's only provide these: en, es, ja, mat, pt. (We can manually add more default languages in the future if those translations are provided).
  • The default selected language should be en (which is currently the case already).
  • A logged in community admin can navigate to the Settings dashboard view (at /member/community) and sees a new section called "Languages". Under this section, there are two fields:
    • A field called "Enabled Languages" which is a select-multiple has_many field (shown via checkboxes akin to how Stories show on the Speaker dashboard, for example) showing all of the languages available in config/locales/. Using this field, community administrator is able to select the subset of languages they want to show for the community welcome screen and throughout the CMS.
    • A field called "Default Language" field, which is a typeahead pulling values from the available languages. Using this field the administrator can set any of the languages in Terrastories as the default for logged in users.
  • For a logged in user loading the Terrastories welcome page, they should see only the languages that have been selected by the community administrator.
  • The default language picker options for a community should also be en, es, ja, mat, pt, until overridden by the community administrator.
  • The default selected language for a community should be en.
  • When a user logs out of the community, they should return to seeing the five default languages for a non-logged in user as per the first step.
  • All of the new strings for the menu in Settings should be added to internationalization (e.g. strings added to all available langauges).

Assets

Screenshot of the welcome screen box with the language picker at the bottom. Currently many languages are included as a default; it should only be en, es, ja, mat, and pt.
image

@rudokemper rudokemper added rails Hacktoberfest Hacktoberfest 2023 labels Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Hacktoberfest 2023 rails
Projects
None yet
Development

No branches or pull requests

1 participant