-
Notifications
You must be signed in to change notification settings - Fork 52
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
I18n support #43
I18n support #43
Conversation
tstrachota
commented
Apr 16, 2014
- Heading in HelpBuilder extracted to a function to make overriding easier.
- Translation table for overriding messages. Usage is:
@mdub ping? |
PR: 192635 Submitted by: Michael Moll <kvedulv@kvedulv.de> Obtained from: mdub/clamp#43
PR: 192635 Submitted by: Michael Moll <kvedulv@kvedulv.de> Obtained from: mdub/clamp#43 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@365651 35697150-7ecd-e111-bb59-0022644237b5
what's the status here? |
The status is that I've been a crap maintainer, and haven't been able to find/make time to even review @tstrachota's PR and provide feedback. Apologies all around, particularly to Tomas. It looks like the PR delegates to a It would help me if someone could provide a example use-case, e.g. a sample set of translated messages. @tstrachota? Would it make sense for the translations to be maintained in the Clamp codebase? For instance, a user could
to enable Polish messages. |
@mdub thanks for looking at the PR again. Example usage is here: I made Tests are currently failing but that's happening also in the master. RSpec changed it's interface with new releases and there's no version restriction in the Gemfile. Fixing tests was easy, so I went that way: #49 Regarding the translations being maintained on the Clamp's side, I intentionally avoided that for following reasons:
|
I like the overal idea of this patch, and I think it could be structured in a way that implies additional language support could be contributed to the project. I like that you want to allow consumers of clamp to provide their own translations in cases where Clamp has no translation (or a poor translation), but I think there's value in providing some kind of locale setting and having Clamp.messages tie the locale together to look up a certain translations. |
I saw travis failed on this PR. I confirm the same when I run this PR locally, but most of the failures are unrelated. I rebased against master, and the spec suite passes. There aren't any tests for this PR. I'm willing to build on this patch and write tests for it as well as adding support for selecting locale and documenting how to add custom locale/translations. Thoughts? |
As a curiosity, is there any reason to avoid using the I18n ruby library for this? |
@jordansissel rebased As for your question: I tried to describe it in #43 (comment) Locale selection is also something that can happen outside clamp not locking users into some specific solution. |
@mdub Hi, would you consider giving @tstrachota permission to maintain and release this gem? It seems to me like a good option to keep this great lib moving forward. Clamp become key part of hammer-cli and distributing patched rpms and debs does not seem like a good solution. Anyway just a thought. |
@pitr-ch Thanks for your suggestion, but (despite having dragged my feet on this PR) I'm not quite ready to hand over the reins yet. I'm (finally) giving this a proper look now. I like the simple "format" string stuff. Needs some tests around @tstrachota, the "hammer-cli" link you posted just duplicates the default translations, doesn't it? I was hoping for an example of translations into a different language. Extracting the |
@mdub we have translations into about 10 languages. See https://github.com/theforeman/hammer-cli/tree/master/locale Regarding the |
@mdub just to clarify: I did not meant to hand it over but just allowing @tstrachota to be a co-maintainer to help out when you are too busy. Anyway thanks for the gem! |
So, I've finally made time to look at this properly. @tstrachota I've refactored it a bit, on a branch. Please let me know what you think, and in particular, whether anything I've done will break your usage in We still need some tests before merging it in. |
@mdub thanks for looking into it! Your changes look good. I like the extraction into a module. |
Excellent! |
@mdub I added tests and some basic docs. Feel free to tune it. |
- Translation table for overriding messages. - Heading in HelpBuilder extracted to a function to make overriding easier.
- makes strings in the Clamp's basic help builder translatable
Thanks, @mdub !! |
thanks! I guess a new release will be out soon? :) |
@mmoll @tstrachota Indeed ... just released as "1.0.0"! |
PR: 192635 Submitted by: Michael Moll <kvedulv@kvedulv.de> Obtained from: mdub/clamp#43