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

Basic i18n-tasks support with custom parser for Spree.t #640

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rposborne
Copy link
Contributor

This is a first pass on a more long term solution, currently this requires i18n-tasks to be installed outside of the gem, as it's incompatible with spree (highline conflicts).

@rposborne rposborne changed the title WIP Basic i18n-tasks support with custom parser for Spree.t Basic i18n-tasks support with custom parser for Spree.t Oct 16, 2015
@rposborne
Copy link
Contributor Author

Removing the WIP tag, as this adds support for the normalize tool which is the big leap forward that we are looking for. There are some issues regarding parsing the spree/spree repo and extracting keys that need to be present, as it requires an unreleased version of i18n-tasks that conflicts with spree/spree_cmd so can't be added to gem spec as is. @alepore @JDutil It would be great if we could get this in.

@alepore
Copy link
Member

alepore commented Oct 20, 2015

will take a look, we really need something like this /cc @mamhoff @tvdeyen

%>

# Add in spree custom scanner in 0.9
<%
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this inlined here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As i18n_tasks runs outside the scope of the parent application. We could add a require but it would still need to be inlined.

Basically that's what the i18n-tasks creator recommended. See glebm/i18n-tasks#170

Copy link

Choose a reason for hiding this comment

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

i18n-tasks add-missing supports a --nil-value argument since v0.9.5, so this is no longer necessary.

@tvdeyen
Copy link
Contributor

tvdeyen commented Oct 20, 2015

This is much greater then the self baked solution.

@glebm
Copy link

glebm commented Mar 6, 2016

Note that a few things have been implemented in i18n-tasks that make this a bit easier:

  1. add-missing now supports a --nil-value argument.
  2. PatternScanner now matches the receiver, so it won't scan Spree.t calls.


# Add in spree custom scanner in 0.9
<%
require './lib/i18n/spree_t_scanner.rb'
Copy link

Choose a reason for hiding this comment

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

.rb extension not necessary

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.

None yet

4 participants