Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

[WIP] docs(guide): document internationalization (i18n) #2309

Closed
wants to merge 1 commit into from

Conversation

ocombe
Copy link

@ocombe ocombe commented Sep 11, 2016

Hello !

Here is the dev guide for internationalization (i18n).

This is my first guide, which means that there are probably a lot of things to improve ! And since I'm french, there might be typos and weird sentences, don't hesitate to tell me what should be changed :-)

edit: @Foxandxss told me that I should add an application with a story, I'll be working on that

@ocombe ocombe mentioned this pull request Sep 12, 2016
21 tasks
@ocombe ocombe changed the title docs(guide): document internationalization (i18n) [WIP] docs(guide): document internationalization (i18n) Sep 12, 2016
@@ -0,0 +1,19 @@
/// <reference path='../_protractor/e2e.d.ts' />
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

Copy link
Member

Choose a reason for hiding this comment

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

We are using it in all examples, I think it has to do with ts-node to be able to understand a few things.

@vicb
Copy link
Contributor

vicb commented Sep 12, 2016

Would be nice to add a short text about placeholders:

<p i18n>this is <b>bold</b></p>
<p i18n>this is an {{ exp }}</p>

@feloy
Copy link

feloy commented Sep 14, 2016

@ocombe First, thanks for this doc.

It could be interesting that you speak about the i18n-placeholder directive (and some others that I could not know).

For information, I've implemented i18n in this app with the help of your doc (ng2-rc.7, angular-cli webpack.9-4): https://github.com/actimeo/simmage-ui

It is not very clear how to choose the language at bootstrap time. I've made a first try with some quick hack to get the language from local storage.

@ocombe
Copy link
Author

ocombe commented Sep 14, 2016

@feloy there will be a complete example added that should help you to know how to select the language at setup
Also what is the "i18n-placeholder" ? it's nowhere in the source of angular

@feloy
Copy link

feloy commented Sep 14, 2016

I've found the code here:
https://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/i18n/extractor_merger.ts#L314

In fact it is possible to mark any translatable attribute, e.g. i18n-placeholder to mark to translate the placeholder one.

@ocombe
Copy link
Author

ocombe commented Sep 14, 2016

Interesting, thanks, I'm not sure if it is intended though, this might be something that could change later and you shouldn't rely on it
What do you think @vicb ?

@Foxandxss
Copy link
Member

Continuing in #2340

@Foxandxss Foxandxss closed this Sep 14, 2016
@vicb
Copy link
Contributor

vicb commented Sep 14, 2016

wahou what happens, too many francais here ;)

@vicb
Copy link
Contributor

vicb commented Sep 14, 2016

Yep i18n-<attrName> is working and here to stay.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants