From 87e641b8fc4bb5ee86e2c70605974734dd07f0dd Mon Sep 17 00:00:00 2001 From: Gus Cantieni <34512397+gcantieni@users.noreply.github.com> Date: Wed, 18 Jul 2018 15:08:07 -0400 Subject: [PATCH] Add i18n section to style guide (fixes #1342) (#1565) --- Style-Guide.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Style-Guide.md b/Style-Guide.md index 3992e34d91..eba52d0deb 100644 --- a/Style-Guide.md +++ b/Style-Guide.md @@ -43,6 +43,15 @@ Please don't use the following name for variable since it is used by our `entryp | planet-db-host | used in the docker script | | planet-db-port | used in the docker script | +### il8n +Planet uses the `il8n` translation module to translate our content and make it accessible. This module can be included in an html tag with the keyword il8n. For example, `

Text to be translated

`. + +If there are no strings enclosed by the tag, or if only interpolation strings are enclosed, then the `il8n` attribute should not be used as it will raise errors during compilation. For example, `

{{interpolatedString}}

` needs no `il8n` tag. + +If text of an attribute needs to be translated an `il8n` translation attribute can be added by including a label with the format `il8n-x` where `x` represents the label that needs to be translated. For example, ``. + +For more information, see the docs [here](https://angular.io/guide/i18n). + ### App Directory Structure Within the `src/app` directory, each feature should have its own directory. Within that directory as we add sub-features, if there are more than 9 files we should create a sub-directory with the same naming convention as files (i.e. Resources Review would be in a `resources-review` directory).