Skip to content

Commit

Permalink
fix bug1 - Move URL base to each language version
Browse files Browse the repository at this point in the history
  • Loading branch information
juniorgasparotto committed Apr 3, 2018
1 parent 0126d86 commit 145122d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 42 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,27 @@ This file contains all the settings for your document. It is composed, compulsor

```xml
<documentation>
<page url-base="https://github.com/user/project">
<page>
<languages>
<language name="pt-br" output="page1-pt-br.md" default="true" />
<language name="en-us" output="page1.md" />
<!--Others languages-->
<language name="pt-br" output="readme-pt-br.md" default="true" url-base="https://github.com/user/project/blob/master/readme-pt-br.md" />
<language name="en-us" output="readme.md" url-base="https://github.com/user/project" />
</languages>
<content>
<include href="files/page1-part1.md" />
<include href="files/page1-part2.md" />
<include href="doc/pages/readme/description.md" />
<include href="doc/pages/readme/install.md" />
<include href="doc/pages/readme/licence.md" />
</content>
</page>

<page url-base="https://github.com/user/project/blob/master">
<page>
<languages>
<language name="pt-br" output="page2-pt-br.md" default="true" />
<language name="en-us" output="page2-en.md" />
<!--Others languages-->
<language name="pt-br" output="doc/pt-br.md" default="true" url-base="https://github.com/user/project/blob/master/doc/pt-br.md" />
<language name="en-us" output="doc/en.md" url-base="https://github.com/user/project/blob/master/doc/en.md" />
</languages>
<content>
<include href="files/page2-part1.md" />
<include href="files/page2-part2.md" />
<include href="doc/pages/suject1.md" />
<include href="doc/pages/suject2.md" />
<include href="doc/pages/suject3.md" />
</content>
</page>
</documentation>
Expand All @@ -131,8 +131,6 @@ This file contains all the settings for your document. It is composed, compulsor

It is mandatory that there is at least one occurrence of this tag. It is composed by the tags `languages` and `content` . She represents a document that can be translated into other languages. Each language version is equivalent to a physical file.

The `url-base` attribute is not required if there is only one tag `page` . It is useful for assembling the anchors with the full path, so you can use anchors that are in another `page` .

**Tag`languages`**

To define a new language, add the tag `language` within the tag `languages` . It is mandatory that there is at least one language configured and that language must be the same as your content. It is obligatory the use of the `default=true` attribute for the default language.
Expand All @@ -142,6 +140,7 @@ Each tag `language` contains the following attributes:
* `name`: Sets the language abbreviation (https://dev.microsofttranslator.com/languages?api-version=1.0)
* `output`: Sets the path where the final file will be saved. The relative folder will always be the folder that executavél this running, but you can change this relative path using the `--base-dir` argument.
* `default`: Defines which tag `language` corresponds to the default language.
* `url-base`: It is not mandatory, but it is interesting there to help in the creation of the anchors with the absolute path, thus avoiding problems by using the method `<anchor-get name="anchor-name" />` . Guaranteed also the creation of anchors that are in other pages: `<anchor-get name="anchor-name-other-page" />` .

**Tag`content`**

Expand Down
27 changes: 13 additions & 14 deletions doc/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,27 @@ Esse arquivo contém todas as configurações do seu documento. Ele é composto,

```xml
<documentation>
<page url-base="https://github.com/user/project">
<page>
<languages>
<language name="pt-br" output="page1-pt-br.md" default="true" />
<language name="en-us" output="page1.md" />
<!--Others languages-->
<language name="pt-br" output="readme-pt-br.md" default="true" url-base="https://github.com/user/project/blob/master/readme-pt-br.md" />
<language name="en-us" output="readme.md" url-base="https://github.com/user/project" />
</languages>
<content>
<include href="files/page1-part1.md" />
<include href="files/page1-part2.md" />
<include href="doc/pages/readme/description.md" />
<include href="doc/pages/readme/install.md" />
<include href="doc/pages/readme/licence.md" />
</content>
</page>

<page url-base="https://github.com/user/project/blob/master">
<page>
<languages>
<language name="pt-br" output="page2-pt-br.md" default="true" />
<language name="en-us" output="page2-en.md" />
<!--Others languages-->
<language name="pt-br" output="doc/pt-br.md" default="true" url-base="https://github.com/user/project/blob/master/doc/pt-br.md" />
<language name="en-us" output="doc/en.md" url-base="https://github.com/user/project/blob/master/doc/en.md" />
</languages>
<content>
<include href="files/page2-part1.md" />
<include href="files/page2-part2.md" />
<include href="doc/pages/suject1.md" />
<include href="doc/pages/suject2.md" />
<include href="doc/pages/suject3.md" />
</content>
</page>
</documentation>
Expand All @@ -132,8 +132,6 @@ Esse arquivo contém todas as configurações do seu documento. Ele é composto,

É obrigatório que exista no mínimo uma ocorrência dessa tag. Ela é composta pelas tags `languages` e `content`. Ela representa um documento que pode ser traduzido para outros idiomas. Cada versão de idioma equivale a um arquivo físico.

O atributo `url-base` não é obrigatório se existir apenas uma tag `page`. Ele é útil para montar as âncoras com o caminho completo, assim você pode usar âncoras que estão em outra `page`.

**Tag `languages`**

Para definir um novo idioma, adicione a tag `language` dentro da tag `languages`. É obrigatório que exista no mínimo um idioma configurado e esse idioma deve ser o mesmo do seu contéudo. É obrigatório o uso do atributo `default=true` para o idioma padrão.
Expand All @@ -143,6 +141,7 @@ O atributo `url-base` não é obrigatório se existir apenas uma tag `page`. Ele
* `name`: Define a sigla do idioma (https://dev.microsofttranslator.com/languages?api-version=1.0)
* `output`: Define o caminho onde o arquivo final será salvo. A pasta relativa será sempre a pasta que o executavél esta sendo executado, mas você pode mudar esse caminho relativo usando o argumento `--base-dir`.
* `default`: Define qual tag `language` corresponde ao idioma padrão.
* `url-base`: Não é obrigatório, mas é interessante existir para ajudar na criação das âncoras com o caminho absoluto, evitando assim problemas ao usar o método `<anchor-get name="anchor-name" />`. Garantido também a criação de âncoras que estão em outras páginas: `<anchor-get name="anchor-name-other-page" />`.

**Tag `content`**

Expand Down
27 changes: 13 additions & 14 deletions readme-pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,27 @@ Esse arquivo contém todas as configurações do seu documento. Ele é composto,

```xml
<documentation>
<page url-base="https://github.com/user/project">
<page>
<languages>
<language name="pt-br" output="page1-pt-br.md" default="true" />
<language name="en-us" output="page1.md" />
<!--Others languages-->
<language name="pt-br" output="readme-pt-br.md" default="true" url-base="https://github.com/user/project/blob/master/readme-pt-br.md" />
<language name="en-us" output="readme.md" url-base="https://github.com/user/project" />
</languages>
<content>
<include href="files/page1-part1.md" />
<include href="files/page1-part2.md" />
<include href="doc/pages/readme/description.md" />
<include href="doc/pages/readme/install.md" />
<include href="doc/pages/readme/licence.md" />
</content>
</page>

<page url-base="https://github.com/user/project/blob/master">
<page>
<languages>
<language name="pt-br" output="page2-pt-br.md" default="true" />
<language name="en-us" output="page2-en.md" />
<!--Others languages-->
<language name="pt-br" output="doc/pt-br.md" default="true" url-base="https://github.com/user/project/blob/master/doc/pt-br.md" />
<language name="en-us" output="doc/en.md" url-base="https://github.com/user/project/blob/master/doc/en.md" />
</languages>
<content>
<include href="files/page2-part1.md" />
<include href="files/page2-part2.md" />
<include href="doc/pages/suject1.md" />
<include href="doc/pages/suject2.md" />
<include href="doc/pages/suject3.md" />
</content>
</page>
</documentation>
Expand All @@ -131,8 +131,6 @@ Esse arquivo contém todas as configurações do seu documento. Ele é composto,

É obrigatório que exista no mínimo uma ocorrência dessa tag. Ela é composta pelas tags `languages` e `content`. Ela representa um documento que pode ser traduzido para outros idiomas. Cada versão de idioma equivale a um arquivo físico.

O atributo `url-base` não é obrigatório se existir apenas uma tag `page`. Ele é útil para montar as âncoras com o caminho completo, assim você pode usar âncoras que estão em outra `page`.

**Tag `languages`**

Para definir um novo idioma, adicione a tag `language` dentro da tag `languages`. É obrigatório que exista no mínimo um idioma configurado e esse idioma deve ser o mesmo do seu contéudo. É obrigatório o uso do atributo `default=true` para o idioma padrão.
Expand All @@ -142,6 +140,7 @@ Cada tag `language` contem os seguintes atributos:
* `name`: Define a sigla do idioma (https://dev.microsofttranslator.com/languages?api-version=1.0)
* `output`: Define o caminho onde o arquivo final será salvo. A pasta relativa será sempre a pasta que o executavél esta sendo executado, mas você pode mudar esse caminho relativo usando o argumento `--base-dir`.
* `default`: Define qual tag `language` corresponde ao idioma padrão.
* `url-base`: Não é obrigatório, mas é interessante existir para ajudar na criação das âncoras com o caminho absoluto, evitando assim problemas ao usar o método `<anchor-get name="anchor-name" />`. Garantido também a criação de âncoras que estão em outras páginas: `<anchor-get name="anchor-name-other-page" />`.

**Tag `content`**

Expand Down

0 comments on commit 145122d

Please sign in to comment.