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

Move translations into extension #1398

Merged
merged 23 commits into from
Apr 11, 2018

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Mar 20, 2018

Removes the Rails translations from our translation files and introduces some new localisation scopes for time and date values.

Also moves all non-english translation files into the newly introduced alchemy_i18n gem

Get back Alchemy translations

If you need more translations than the default English one you can either put alchemy_i18nin to your apps Gemfile or - recommended - copy only the translation files you need into your apps config/locales folder.

Get back the Rails translations

Either put the rails-i18n gem into your apps Gemfile or - recommended - copy only the translation files you need into your apps config/locales folder.

Closes #1345

TODO

  • Fix specs
  • Add a note about alchemy_i18n to README
  • Add upgrader notice
  • Move Kaminari translations into alchemy_i18n
  • Move the simple form translations into alchemy_i18n
  • Move the javascript translations into alchemy_i18n
  • Re-move the TinyCME translations
  • Re-move the select2 translations
  • Remove the devise translations from alchemy-devise
  • Move the alchemy translations from alchemy-devise into alchemy_i18n

@tvdeyen tvdeyen added this to the 4.1 milestone Mar 20, 2018
@tvdeyen tvdeyen self-assigned this Mar 20, 2018
@tvdeyen tvdeyen force-pushed the remove-rails-translations branch 2 times, most recently from dcfceb2 to 40d4c8f Compare March 26, 2018 08:03
@AlchemyCMS AlchemyCMS deleted a comment from houndci-bot Mar 26, 2018
@AlchemyCMS AlchemyCMS deleted a comment from houndci-bot Mar 26, 2018
@tvdeyen tvdeyen mentioned this pull request Mar 26, 2018
@tvdeyen tvdeyen removed their assignment Mar 26, 2018
@tvdeyen tvdeyen self-assigned this Mar 26, 2018
@tvdeyen tvdeyen changed the title Remove rails translations Remove translations Mar 26, 2018
@tvdeyen tvdeyen changed the title Remove translations WIP Remove translations Mar 26, 2018
Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming
.rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml
`Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming
.rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml
`Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead

The default localization of `Time`s `date` format differs in each Rails app. We should have our own date format for `EssenceDate`.
Adds new `time_format` and `datetime_format` options for rendering resources. Defaults to `alchemy.default` and `alchenm.time`
To bring them back into your app you need to either add the `rails-i18n` gem or - recommended - copy the Rails locale file of the locales you support into your apps `config/locales` folder.
In order to provide alchemy translations in other gems as well we use the `I18n.load_path` to get all Alchemy translations.
Move the translation files from here into the new `alchemy_i18n` gem.

If you need more translations than the default english one you can either put `alchemey_i18n` to your apps `Gemfile` or - recommended - copy the translation files you need into your apps locales folder.

The translation files can be found at https://github.com/AlchemyCMS/alchemy_i18n/tree/master/config/locales.
This feature spec expects that translation files are actually present.
Instead it should just test what it actually does: Setting `I18n.lcoale`
and store it in the session.
Add latest simple form config and keep our changes.
Move them into the newly introduced `alchemy_i18n` gem.
You need to require the select2 locale you want to use explicitly in your `vendor/assets/alchemy/admin/all.js` file

```js
//= require select2_locale_de
//= require select2_locale_es
```
@tvdeyen tvdeyen changed the title WIP Remove translations Remove translations Apr 3, 2018
Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml
`Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead

@tvdeyen tvdeyen removed their assignment Apr 3, 2018
@tvdeyen tvdeyen changed the title Remove translations Move translations into extension Apr 5, 2018
@tvdeyen tvdeyen self-assigned this Apr 5, 2018
1. Includes available locales from multiple sources only once
2. Supports long locale names (ie. zh-CN)
3. Sorts the output
In order to be able to push the default English translation to localeapp.com
@tvdeyen tvdeyen merged commit 94dd6a8 into AlchemyCMS:master Apr 11, 2018
@tvdeyen tvdeyen deleted the remove-rails-translations branch April 11, 2018 09:56
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