prat0318 / json_resume

Generates pretty HTML, LaTeX, markdown, with biodata feeded as input in JSON
http://prat0318.github.io/json_resume
MIT License
1.36k stars 116 forks source link

i18n on templates #3

Closed delucas closed 10 years ago

delucas commented 10 years ago

Add support for different languages. I'd love to help with Spanish, and a PR with the basic mechanism for i18n templating. Can we discuss the implementation?

prat0318 commented 10 years ago

Sure, i would :heart: to add that.

delucas commented 10 years ago

After a little research, I see no out-of-the-box support for i18n on mustache. I think you provide proper functionality with templates.

Maybe it can be added as scoped variables à-la-rails, in a yml file. Example with summary:

{{#summary}}
<h2><span class="glyphicon glyphicon-compressed"></span>{{summary}}</h2>
<ul>
    {{#points}}
    <li>{{{.}}}</li>
    {{/points}}
</ul>
{{/summary}}

And invoked like:

json_resume convert --lang=es example.json

Now: how can it be implemented, without affecting the free-templating capability?

prat0318 commented 10 years ago

Isn't the summary example the same as in the template. I couldn't notice the difference. I will research on the solutions in free time. Let me know if you have some ideas.

delucas commented 10 years ago

It's almost the same. Notice the mustache variable on the section title

            L.-

On Fri, Jun 27, 2014 at 1:55 PM, Prateek Agarwal notifications@github.com wrote:

Isn't the summary example the same as in the template. I couldn't notice the difference. I will research on the solutions in free time. Let me know if you have some ideas.

— Reply to this email directly or view it on GitHub https://github.com/prat0318/json_resume/issues/3#issuecomment-47373762.

prat0318 commented 10 years ago

Ah.. i see what you meant. I agree keeping all of the visible text out of the templates would be a good step towards i18n.

prat0318 commented 10 years ago

Added 98fce6aa9c0399a856b1b49471829527e69c53b5 to add i18n for --locale=en|es|pt

prat0318 commented 10 years ago

@delucas can you confirm if the spanish conversions make sense (i used google translate) es translations

delucas commented 10 years ago

Made a little PR. Great job!

prat0318 commented 10 years ago

Thanks @delucas for a prompt PR :heart: