Skip to content

Commit

Permalink
Eliminate the need to include HTML comments to make some extensions work
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed May 4, 2021
1 parent 426d41e commit 9b5bfbd
Show file tree
Hide file tree
Showing 17 changed files with 341 additions and 616 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.1
current_version = 0.0.2

[bumpversion:file:mkdocs_mdpo_plugin/__init__.py]

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package.json
package-lock.json
/node_modules/
prueba.html
output.txt

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!--description-start-->

Translations for Mkdocs using PO files, fully customizable but simple and easy.
Translations for Mkdocs using PO files, fully customizable.
Compatible with [mkdocs-material](https://squidfunk.github.io/mkdocs-material),
based on [mdpo](https://mdpo.readthedocs.io).

Expand Down
8 changes: 0 additions & 8 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ edit the content of your files:
Languages to translate your files into. Commonly defined as
[ISO 639 codes](https://en.wikipedia.org/wiki/ISO_639).

<!-- mdpo-disable-next-line -->
!!! note

If you are using [mkdocs-material](https://squidfunk.github.io/mkdocs-material)
Expand All @@ -31,7 +30,6 @@ Languages to translate your files into. Commonly defined as
Original language of your files. If not defined, the first language found in
[`languages`](#languages-list) will be used.

<!-- mdpo-disable-next-line -->
!!! note

If you are using [mkdocs-material](https://squidfunk.github.io/mkdocs-material)
Expand All @@ -47,7 +45,6 @@ Directory inside your documentation where the PO translation files will be
placed. If not defined, the root of `docs` (`docs_dir` setting) will be used,
so the default layout would be something like:

<!-- mdpo-disable-next-line -->
=== "Configuration"

```yaml
Expand All @@ -59,7 +56,6 @@ so the default layout would be something like:
- fr
```

<!-- mdpo-disable-next-line -->
=== "Documentation directories tree"

```
Expand All @@ -75,7 +71,6 @@ Defining it to `locale`, the layout will change a bit, but this doesn't mean
that this new `locale/` folder will be included in the `site/` directory
(see [`dest_filename_template`](#dest_filename_template-str)).

<!-- mdpo-disable-next-line -->
=== "Configuration"

```yaml
Expand All @@ -88,7 +83,6 @@ that this new `locale/` folder will be included in the `site/` directory
locale_dir: locale
```

<!-- mdpo-disable-next-line -->
=== "Documentation directories tree"

```
Expand All @@ -111,7 +105,6 @@ as `true`, but if you want another folder name, you can pass a string, or even
a relative path to create more than one folder between the language directory
and their content:

<!-- mdpo-disable-next-line -->
=== "true"

=== "Configuration"
Expand Down Expand Up @@ -141,7 +134,6 @@ and their content:
└── index.md
```

<!-- mdpo-disable-next-line -->
=== "Custom value"

=== "Configuration"
Expand Down
155 changes: 70 additions & 85 deletions docs/es/config.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ msgstr ""
"plugins que pudieran editar el contenido de tus archivos:"

msgid ""
"Languages to translate your files into. Commonly defined as [ISO 639 "
"codes](https://en.wikipedia.org/wiki/ISO_639)."
"Languages to translate your files into. Commonly defined as [ISO 639 codes]"
"(https://en.wikipedia.org/wiki/ISO_639)."
msgstr ""
"Idiomas a los que traducir tus archivos. Comúnmente definidos como [códigos "
"ISO 639](https://es.wikipedia.org/wiki/ISO_639)."

msgid "Permanent link"
msgstr "Link permanente"

msgid ""
"Directory inside your documentation where the PO translation files will be "
"placed. If not defined, the root of `docs` (`docs_dir` setting) will be "
Expand All @@ -51,44 +48,20 @@ msgstr ""
"traducción."

msgid ""
"Template for destination file name inside `site/` directory. This is a valid"
" [Jinja2 "
"template](https://jinja2docs.readthedocs.io/en/stable/templates.html) string"
" that will be used to define where should be placed the generated translated"
" file inside the `site/` directory."
"Template for destination file name inside `site/` directory. This is a valid "
"[Jinja2 template](https://jinja2docs.readthedocs.io/en/stable/templates."
"html) string that will be used to define where should be placed the "
"generated translated file inside the `site/` directory."
msgstr ""
"Plantilla para el nombre del archivo destino dentro del directorio `site/`. "
"Esto es una cadena para una plantilla [Jinja2 "
"template](https://jinja2docs.readthedocs.io/en/stable/templates.html) válida"
" que será usada para definir donde debe ser colocado el archivo traducido "
"generado dentro del directorio `site/`."
"Esto es una cadena para una plantilla [Jinja2 template](https://jinja2docs."
"readthedocs.io/en/stable/templates.html) válida que será usada para definir "
"donde debe ser colocado el archivo traducido generado dentro del directorio "
"`site/`."

msgid "The context for the template includes:"
msgstr "El contexto para la plantilla incluye:"

msgid "`language`: Translation language for the page."
msgstr "`language`: Idioma de la traducción para la página."

msgid ""
"`page`: The original Markdown page object inside your documentation "
"directory."
msgstr ""
"`page`: El objeto de la página Markdown original dentro de tu directorio de "
"documentación."

msgid "`po_filepath`: The path of the PO file wich contains the translations."
msgstr ""
"`po_filepath`: La ruta de los archivos PO la cual contiene las traducciones."

msgid ""
"`po`: A "
"[`polib.POFile`](https://polib.readthedocs.io/en/latest/api.html#polib.POFile)"
" object with the translations loaded."
msgstr ""
"`po`: Un objeto "
"[`polib.POFile`](https://polib.readthedocs.io/en/latest/api.html#polib.POFile)"
" con las traducciones cargadas."

msgid ""
"All the configuration settings of the plugin such as `languages`, "
"`default_language`, `lc_messages`, `locale_dir`, `dest_filename_template` "
Expand All @@ -103,6 +76,38 @@ msgstr "Idiomas"
msgid "Layout"
msgstr "Estructura"

msgid ""
"Original language of your files. If not defined, the first language found in "
"[`languages`](#languages-list) will be used."
msgstr ""
"Idioma original de tus archivos. Si no se define, el primer idioma "
"encontrado en [`languages`](#languages-list) será usado."

msgid ""
"Defining it to `locale`, the layout will change a bit, but this doesn't mean "
"that this new `locale/` folder will be included in the `site/` directory "
"(see [`dest_filename_template`](#dest_filename_template-str))."
msgstr ""
"Definiéndolo a `locale`, la estructura cambiará un poco, pero esto no "
"significa que esta nueva carpeta `locale/` será incluida en el directorio "
"`site/` (ver [`dest_filename_template`](#dest_filename_template-str))."

msgid ""
"In the world of program translation is common the creation of a `LC_MESSAGES/"
"` folder inside the language directory. If you need it you can set this "
"setting as `true`, but if you want another folder name, you can pass a "
"string, or even a relative path to create more than one folder between the "
"language directory and their content:"
msgstr ""
"En el mundo de la traducción de programas es común la creación de una "
"carpeta `LC_MESSAGES` dentro del directorio de idioma. Si la necesitas, "
"puedes definir este ajuste como `true`, pero si quieres otro nombre de "
"carpeta, puedes pasar una cadena, o incluso una ruta relativa para crear más "
"de una carpeta entre el directorio de idioma y su contenido:"

msgid "Permanent link"
msgstr "Link permanente"

msgid "Note"
msgstr "Nota"

Expand All @@ -112,68 +117,48 @@ msgid ""
"setting (see [Site language selector](https://squidfunk.github.io/mkdocs-"
"material/setup/changing-the-language/#site-language-selector))."
msgstr ""
"Si estás usando el tema [mkdocs-"
"material](https://squidfunk.github.io/mkdocs-material), también puede ser "
"definido en el ajuste de configuración `extra.alternate` (ver [Selector de "
"lenguaje](https://squidfunk.github.io/mkdocs-material/setup/changing-the-"
"language/#site-language-selector))."
"Si estás usando el tema [mkdocs-material](https://squidfunk.github.io/mkdocs-"
"material), también puede ser definido en el ajuste de configuración `extra."
"alternate` (ver [Selector de lenguaje](https://squidfunk.github.io/mkdocs-"
"material/setup/changing-the-language/#site-language-selector))."

msgid ""
"If you are using [mkdocs-material](https://squidfunk.github.io/mkdocs-"
"material) theme, can also be defined in the `theme.language` configuration "
"setting (see [Site language](https://squidfunk.github.io/mkdocs-"
"material/setup/changing-the-language/#site-language))."
"setting (see [Site language](https://squidfunk.github.io/mkdocs-material/"
"setup/changing-the-language/#site-language))."
msgstr ""
"Si estás usando el tema [mkdocs-"
"material](https://squidfunk.github.io/mkdocs-material), también puede ser "
"definido en el ajuste de configuración `theme.language` (ver [Idioma de "
"sitio](https://squidfunk.github.io/mkdocs-material/setup/changing-the-"
"language/#site-language))."
"Si estás usando el tema [mkdocs-material](https://squidfunk.github.io/mkdocs-"
"material), también puede ser definido en el ajuste de configuración `theme."
"language` (ver [Idioma de sitio](https://squidfunk.github.io/mkdocs-material/"
"setup/changing-the-language/#site-language))."

msgid "Custom value"
msgstr "Valor personalizado"

msgid ""
"Original language of your files. If not defined, the first language found in"
" [`languages`](#languages-list) will be used."
msgstr ""
"Idioma original de tus archivos. Si no se define, el primer idioma "
"encontrado en [`languages`](#languages-list) será usado."

msgid "Documentation directories tree"
msgstr "Árbol de directorios de documentación"

msgid "true"
msgstr "true"

msgid "`language`: Translation language for the page."
msgstr "`language`: Idioma de traducción para la página."

msgid ""
"Defining it to `locale`, the layout will change a bit, but this doesn't mean"
" that this new `locale/` folder will be included in the `site/` directory "
"(see [`dest_filename_template`](#dest_filename_template-str))."
"`page`: The original Markdown page object inside your documentation "
"directory."
msgstr ""
"Definiéndolo a `locale`, la estructura cambiará un poco, pero esto no "
"significa que esta nueva carpeta `locale/` será incluida en el directorio "
"`site/` (ver [`dest_filename_template`](#dest_filename_template-str))."
"`page`: El objeto de la página Markdown original dentro de tu directorio de "
"documentación."

msgid "`po_filepath`: The path of the PO file wich contains the translations."
msgstr ""
"`po_filepath`: La ruta del archivo PO el cual contiene las traducciones."

msgid ""
"In the world of program translation is common the creation of a "
"`LC_MESSAGES/` folder inside the language directory. If you need it you can "
"set this setting as `true`, but if you want another folder name, you can "
"pass a string, or even a relative path to create more than one folder "
"between the language directory and their content:"
"`po`: A [`polib.POFile`](https://polib.readthedocs.io/en/latest/api."
"html#polib.POFile) object with the translations loaded."
msgstr ""
"En el mundo de la traducción de programas es común la creación de una "
"carpeta `LC_MESSAGES` dentro del directorio de idioma. Si la necesitas, "
"puedes definir este ajuste como `true`, pero si quieres otro nombre de "
"carpeta, puedes pasar una cadena, o incluso una ruta relativa para crear más"
" de una carpeta entre el directorio de idioma y su contenido:"

#~ msgid "true"
#~ msgstr "true"

#~ msgid ""
#~ "In the world of program translation is common the creation of a "
#~ "`LC_MESSAGES/` folder the language folder. If you need it you can set this "
#~ "setting as `true`, but if you want another folder name, you can pass a "
#~ "string, or even a relative path to create more than one folder between the "
#~ "language directory and their content:"
#~ msgstr ""
#~ "En el mundo de la traducción de programas es común la creación de un "
#~ "directorio `LC_MESSAGES/` "
"`po`: Un objeto [`polib.POFile`](https://polib.readthedocs.io/en/latest/api."
"html#polib.POFile) con las traducciones cargadas."
Loading

0 comments on commit 9b5bfbd

Please sign in to comment.