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

Splitting po file #29

Closed
migmartri opened this issue Apr 30, 2011 · 2 comments
Closed

Splitting po file #29

migmartri opened this issue Apr 30, 2011 · 2 comments

Comments

@migmartri
Copy link

Hello.

I would like to split my po file(app.po) into 2 files one for the admin section and other for the public view of my app. How can I do that?. I have been checking text_domain things but I am not able to find the way to do it.

The point is, is there any way to do rake gettext:find and get two different po files even if that requires me some markup work?

Thank you very much.

Best.

Miguel

@grosser
Copy link
Owner

grosser commented Apr 30, 2011

hmmmm at first Id suggest that a before_filter sets the correct text-domain for each request.

Idea 1
adjust the first gettext:find pattern to Dir.glob("{app,lib,config,#{locale_path}}/**/*.{rb,erb,haml}").reject{|f|f.include?('admin')}
make a second gettext:find command and use the opposite
Dir.glob("{app,lib,config,#{locale_path}}/**/*.{rb,erb,haml}").select{|f|f.include?('/admin/')}

Idea 2
run rake gettext:find and then copy the resulting po files to e.g. admin.po
and then remove any translation that has only usages in admin from the original and remove any translation that has no usage in admin from the second one.

idea 3
move all the admin stuff to tmp, run gettext:find and then move them back

if you do any po-parsing get_pomo could be helpful

hope one of these works :D

@grosser grosser closed this as completed Apr 30, 2011
@migmartri
Copy link
Author

Thank you grosser.

I will check it out!

Thanks!

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

No branches or pull requests

2 participants