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

Add documentation #34

Open
rauberdaniel opened this issue Mar 25, 2014 · 30 comments
Open

Add documentation #34

rauberdaniel opened this issue Mar 25, 2014 · 30 comments
Assignees

Comments

@rauberdaniel
Copy link

Please add some basic documentation about how to install and use this plugin.

@ain
Copy link
Member

ain commented Mar 25, 2014

👍

Valid request, I was already thinking of doing it (as we're using it in
production). Will definitely happen soon :)

@doowb
Copy link
Member

doowb commented Mar 25, 2014

@ain if you're going to add some documentation, take a look at verb and grunt-verb

@AoDev
Copy link

AoDev commented Jun 17, 2014

Hello,

Thanks for your work. Any news about some basic documentation?

@ain
Copy link
Member

ain commented Jun 18, 2014

Yes, I've just today, on our performance intensive compilation, added options for unikeys and gc which helped me to cut memory consumption by 6x. I'll push a PR at the earliest possibility and once PRs get merged, also add the docu.

@AoDev
Copy link

AoDev commented Jun 18, 2014

Thank you. My project main feature is based on i18n support and content translation. So I chose Assemble and the i18n middleware which should be a good fit :)

@ain
Copy link
Member

ain commented Jun 18, 2014

Yes. That's exactly the nature of our project too, as you can see at
http://sennheiser-momentum.com ;)

@jonschlinkert
Copy link
Member

👍

@NotBobTheBuilder
Copy link

Any updates on this, or alternatively can someone point me to an example project?

Thanks!

@LaurentGoderre
Copy link
Contributor

Really sorry about that. We rely on it heavily so I should be doing the documentation but I am crazy busy

Here's where we use it.

https://github.com/wet-boew/wet-boew/blob/master/Gruntfile.coffee#L401-L413

@LaurentGoderre
Copy link
Contributor

Note that the list of languages comes from another task that takes a csv and creates the JSON files.

@LaurentGoderre LaurentGoderre self-assigned this Jul 8, 2014
@nobitagit
Copy link

+1 for having a little documentation for this. Starred and watched this useful project.

@kluplau
Copy link

kluplau commented Jan 13, 2015

Great. What's the status? I have no idea how this works, would love an example at least... :-)

@LaurentGoderre
Copy link
Contributor

I should get on it but I can help you with your use case in the meantime

@kluplau
Copy link

kluplau commented Jan 20, 2015

Thanks. I want to add a module for a specific language, so I would like to check if a translation is defined, and if it was, I would render the module. How can I make that check?

@LaurentGoderre
Copy link
Contributor

The way this works, you have to specify in the Gruntfile which languages your support. You can do that by specifying it manually or by using grunt file matching to list he languages you have. Do you have a repo I can look at?

Btw, here's one of our tasks for this middleware. We use a list of langauge from a task that splits a csv file to seperate .json file for each language

https://github.com/wet-boew/wet-boew/blob/master/Gruntfile.coffee#L461-L473

@kluplau
Copy link

kluplau commented Jan 20, 2015

Thanks. That wasn't exact what I was looking for tho. I use your test-example from Github, and uses the permalink-version.

What I would like, is that if the description in fr.json wan't entered, then the description block shouldn't be rendered. This way I can have the languages controlling what elements there is on the page. For example, in Denmark there is a strict cookie law, which means that each page has to have a overlay of some kind that explains how you use cookies. But on most other languages, that's not required.

Somthing like:

{{i18n exist="description"}}
{{i18n "description}}
{{/i18n}}

Can that be achievable?

@LaurentGoderre
Copy link
Contributor

That use case is not supported at least not in this syntax...let me think about this one

@kluplau
Copy link

kluplau commented Jan 27, 2015

Have you had any chance to look at it?

@LaurentGoderre
Copy link
Contributor

Is that the only difference you need? Would you still have one template driving the generation of pages in multiple languages?

@kluplau
Copy link

kluplau commented Jan 27, 2015

Yes. Why? Do you think that's a poor approach?

@LaurentGoderre
Copy link
Contributor

No no, I don't think it should be too hard. I should have something tomorrow

@kluplau
Copy link

kluplau commented Jan 29, 2015

Hi again. How's it going?
I was wondering another thing as well. Is it possible to support Pages Collections, with different layouts?
http://assemble.io/docs/Pages-Collections.html

@ain
Copy link
Member

ain commented Jan 29, 2015

@BlueBlau layouts aren't the scope of i18n, but yes you can.

@kluplau
Copy link

kluplau commented Jan 29, 2015

@ain Great. How would I achieve this? I'm used to do this in regular Assemble, but I failed to figure out how to do it with i18n.

How can I achieve this?

@kluplau
Copy link

kluplau commented Feb 3, 2015

@LaurentGoderre Have you had a chance to look at this?
@ain Do you have a solution/approach I can try out?

@LaurentGoderre
Copy link
Contributor

Perhaps it's not the most elegant solution but this works

---
title: Home
heading: 'Yo, Assemble!'
lead: Welcome to my blog!
warning: '<%= i18n[language].warning %>'
---
<div class="jumbotron">
  <h1>{{ heading }}</h1>
  {{#if warning}}<p>{{warning}}</p>{{/if}}
  <p>{{{i18n "paragraph"}}}</p>
</div>

@LaurentGoderre
Copy link
Contributor

Here's the repo that I promised (sorry for the delay)

https://github.com/LaurentGoderre/i18n-demo

@fixcl
Copy link

fixcl commented Feb 25, 2015

@LaurentGoderre Thanks for the demo is very clear. but you can use Markdown instead of YML?

@LaurentGoderre
Copy link
Contributor

I believe you can. BTW, both are not mutually exclusive, the code between --- is what is called front matter and can be used on Handlebars or Markdown files and can either be in YAML or JSON syntax

@Evand3r
Copy link

Evand3r commented Mar 24, 2021

Documentation coming any time soon?

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