Skip to content

Add i18n-js to OpenProject#2

Closed
schmidt wants to merge 3 commits intoopf:masterfrom
finnlabs:feature/i18n-js
Closed

Add i18n-js to OpenProject#2
schmidt wants to merge 3 commits intoopf:masterfrom
finnlabs:feature/i18n-js

Conversation

@schmidt
Copy link
Contributor

@schmidt schmidt commented Dec 12, 2012

Why client side I18n?

Client-side I18n is needed in a multitude of cases. At the moment, the two UI widgets in OpenProject, Calendar and Wiki Toolbar, use two separate I18n solutions. Every plugin, that is trying to do client-side I18n, will need to ship a third, fourth and fifth solution.

By introducing i18n-js into the OpenProject core, we can provide a single solution for future enhancements of the core and a generic solution for plugin authors.

Why i18n-js?

  • The plugin seems to be rather popular (Starred: > 500, Forked: > 100 atm).
  • It claims to support Rails 3 (not tested by me).
  • Its working principals are simple enough to take over development or replace it with something else, if need be.

This pull request is based on #52 in the finnlabs/chiliproject repository.

Impact on existing users

The install guide needs to be changed. The public/javascripts/i18n directory needs to writable, just like the public/plugin_assets.

Usage

I18n keys in the js scope will be available on the client side.

en:
  js:
    hello: Hello, World!

Especially for plugin authors, also js scopes in deeper nestings will be available

en:
  my_plugin:
    js:
      hello: Hello from plugin!

In your JS code, use the following commands:

I18n.t('js.hello'); // => "Hello, World!"
I18n.t('js.my_plugin.hello'); // => "Hello from plugin!"

GarstgerUnhold and others added 2 commits September 3, 2012 16:27
* Limit i18n keys in JS to the 'js' scope to reduce payload
* Update i18n gem to make i18n-js work with limited scopes
* Exporting translations on server start and not on every request to save
  computing resources and avoid impact on response times
* Configuring i18n-js to use the same fallbacks like the ruby part to ensure
  consistent behavior across languages
* Removing rake tasks from Rakefile since (a) they do not belong there - should
  have been in lib/tasks - and (b) they are no longer needed, since the export
  happens at server start

NB: public/javascripts/i18n needs to be writeable by the app server user.
The js lib does not expect the current locale to be the first fallback, but
that's no good reason to change the original array, which is used by the ruby
i18n.
@apfelfabrik
Copy link
Contributor

Closing this one again, since referencing it somehow reopened it.

linki added a commit that referenced this pull request Mar 3, 2014
linki added a commit that referenced this pull request Mar 4, 2014
linki added a commit that referenced this pull request Mar 6, 2014
linki added a commit that referenced this pull request Mar 21, 2014
linki added a commit that referenced this pull request Mar 28, 2014
linki added a commit that referenced this pull request Apr 3, 2014
linki added a commit that referenced this pull request May 2, 2014
linki added a commit that referenced this pull request May 12, 2014
linki added a commit that referenced this pull request Jul 9, 2014
mfrister added a commit that referenced this pull request Jul 14, 2014
myabc pushed a commit that referenced this pull request Jul 14, 2014
linki added a commit that referenced this pull request Jul 17, 2014
linki added a commit that referenced this pull request Jul 24, 2014
linki added a commit that referenced this pull request Jul 28, 2014
linki added a commit that referenced this pull request Aug 4, 2014
linki added a commit that referenced this pull request Sep 5, 2014
NobodysNightmare pushed a commit that referenced this pull request Oct 1, 2014
NobodysNightmare pushed a commit that referenced this pull request Oct 1, 2014
linki added a commit that referenced this pull request Oct 13, 2014
linki added a commit that referenced this pull request Oct 30, 2014
linki added a commit that referenced this pull request Oct 30, 2014
oliverguenther added a commit that referenced this pull request Jun 23, 2017
* Don't use expect in retry_block

It doesn't raise an exception, but only marks the example erroneous

* Replace textile_link cuke

* Replace wp search cuke with existing spec

We only need to test for the href, no need to check that the page exists.

* Also remove pagination cuke, its part of the search-spec

[ci skip]
ulferts added a commit that referenced this pull request Nov 15, 2018
ulferts added a commit that referenced this pull request Nov 15, 2018
crohr added a commit that referenced this pull request Nov 24, 2020
dombesz added a commit that referenced this pull request Aug 9, 2022
dombesz added a commit that referenced this pull request Aug 9, 2022
dombesz added a commit that referenced this pull request Aug 9, 2022
dombesz added a commit that referenced this pull request Aug 9, 2022
dombesz added a commit that referenced this pull request Aug 9, 2022
dombesz added a commit that referenced this pull request Aug 9, 2022
dombesz added a commit that referenced this pull request Aug 11, 2022
dombesz added a commit that referenced this pull request Aug 11, 2022
dombesz added a commit that referenced this pull request Aug 11, 2022
dombesz added a commit that referenced this pull request Aug 11, 2022
dombesz added a commit that referenced this pull request Aug 11, 2022
dombesz added a commit that referenced this pull request Aug 11, 2022
dombesz added a commit that referenced this pull request Aug 15, 2022
dombesz added a commit that referenced this pull request Dec 7, 2022
dombesz added a commit that referenced this pull request Dec 7, 2022
Eric-Guo referenced this pull request in Eric-Guo/openproject Apr 24, 2024
# This is the 1st commit message:

项目成员信息添加专业,公司部门职位信息仅对管理员显示

# This is the commit message #2:

项目成员信息添加专业,公司部门职位信息仅对管理员显示
Eric-Guo referenced this pull request in Eric-Guo/openproject Apr 24, 2024
# This is the 1st commit message:

yarn install

# This is the commit message #2:

gem and yarn upgrade

# This is the commit message #3:

Yarn to run Angular 17

# This is the commit message opf#4:

gem and yarn upgrade
Eric-Guo referenced this pull request in Eric-Guo/openproject May 19, 2024
# This is the 1st commit message:

Link to outside plugin.

New labour_tracking modules
openproject-labour_tracking update

# This is the commit message #2:

Move th_projects to outside.

# This is the commit message #3:

yarn upgrade

# This is the commit message opf#4:

gem and yarn upgrade

# This is the commit message opf#5:

yarn upgrade

# This is the commit message opf#6:

gem upgrade

# This is the commit message opf#7:

yarn upgrade

# This is the commit message opf#8:

yarn upgrade
Eric-Guo referenced this pull request in Eric-Guo/openproject May 19, 2024
# This is the 1st commit message:

Link to outside plugin.

New labour_tracking modules
openproject-labour_tracking update

# This is the commit message #2:

Move th_projects to outside.

# This is the commit message #3:

yarn upgrade

# This is the commit message opf#4:

gem and yarn upgrade

# This is the commit message opf#5:

yarn upgrade

# This is the commit message opf#6:

gem upgrade

# This is the commit message opf#7:

yarn upgrade

# This is the commit message opf#8:

yarn upgrade

# This is the commit message opf#9:

gem and yarn upgrade

# This is the commit message opf#10:

yarn upgrade

# This is the commit message opf#11:

gem and yarn upgrade
dombesz added a commit that referenced this pull request Mar 7, 2025
…y_activity_spec

Fix more non synchronous capybara expectations #2
akabiru pushed a commit that referenced this pull request Feb 11, 2026
Use an extension to fetch/commit data to OpenProject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants