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

Made it possible to switch UI to english in development #384

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

damisul
Copy link
Collaborator

@damisul damisul commented Jun 14, 2024

If BY_LANGUAGE env variable is provided it will try to use given locale as default.
For now only en or he locale is accepted (and only in dev environment)

I've added dotenv gem to simply manage env variables in development and test. I plan to use it also in #166

You can create .env.development.local file and override BY_LANGUAGE value there instead of overwriting .env.development

@@ -0,0 +1 @@
BY_LANGUAGE=he
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provided as an example for dotenv config. To override it locally create a new file .env.development.local (should not be committed to git)

@@ -68,16 +68,11 @@
# Enable threaded mode
# config.threadsafe!

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already specified in application.rb

# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

config.action_mailer.delivery_method = :sendmail # let's start sending mail :)
config.eager_load = true
config.i18n.available_locales = :he
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already specified in application.rb

@@ -102,10 +97,6 @@
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
Copy link
Collaborator Author

@damisul damisul Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was a duplicate line and now specified in application.rb

@damisul damisul marked this pull request as draft June 14, 2024 13:27
…sing BY_LANGUAGE env variable.

Added dotenv gem to easily manage env variables in development
@@ -54,7 +55,6 @@
#config.assets.debug = true
config.eager_load = false
# config.public_file_server.enabled = true # Rails 5.x?
config.i18n.available_locales = :he
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined in application.rb

@@ -1,4 +1,5 @@
en:
edit_metadata: Edit metadata
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added for tests

@damisul damisul marked this pull request as ready for review June 14, 2024 17:14
@damisul damisul requested a review from abartov June 14, 2024 17:14
@abartov abartov merged commit ed3019f into master Jun 14, 2024
7 checks passed
@abartov abartov deleted the english_ui_in_development branch June 14, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants