diff --git a/content/posts/translation/content/hero.jpg b/content/posts/translation/content/hero.jpg new file mode 100644 index 00000000..1354c472 Binary files /dev/null and b/content/posts/translation/content/hero.jpg differ diff --git a/content/posts/translation/content/index.es.md b/content/posts/translation/content/index.es.md index 821e9a5b..60dd3be1 100644 --- a/content/posts/translation/content/index.es.md +++ b/content/posts/translation/content/index.es.md @@ -1,6 +1,9 @@ --- title: "Como traducir las publicaciones" date: 2020-06-07T06:20:50+06:00 +author: + name: BernatBC + image: images/author/bernatbc.png menu: sidebar: name: Traduciendo Publicaciones @@ -9,4 +12,20 @@ menu: weight: 520 --- -## Próximamente....... +Este tema tiene soporte integrado para varios idiomas. + +Antes de empezar la traducción de la publicación, asegúrese de haber habilitado el idioma en su sitio. Si ese no es el caso, puedes seguir la sección `Añade el idioma en el sitio` de la guía [Como traducir los datos de la página de inicio](/es/posts/translation/site-data/). + +## Creando la publicación + +Una vez que haya agregado el idioma deseado a su sitio web, sepa que puede traducir publicaciones a ese idioma. Asumiremos que deseas traducir una publicación existente. + +### Creado el archivo index + +El primer paso es localizar el archivo `index.md` del post que deseas traducir. Después, crea un archivo en el mismo directorio (o simplemente copia el archivo `index.md`), y nómbralo `index..md`, dónde `` es el código que encontrará en la tabla de idiomas de [Como traducir los datos de la página de inicio](/es/posts/translation/site-data/). + +### Traduce la publicación + +Ahora ya puede empezar traduciendo la publicación, de la misma forma que escribes una publicación nueva. + +> INFORMACIÓN: Si está tratando con referencias internas, necesitarás añadir el prefijo `/` delante del path relativo. Por ejemplo, si quieres crear un link que apunta a `/posts/translation/site-data/`, el link de la publicación traducida será `//posts/translation/site-data/`. diff --git a/content/posts/translation/content/index.md b/content/posts/translation/content/index.md index 6033dbd7..cbbeba15 100644 --- a/content/posts/translation/content/index.md +++ b/content/posts/translation/content/index.md @@ -1,6 +1,9 @@ --- title: "How to Translate Posts" -date: 2020-06-07T06:20:50+06:00 +date: 2024-01-15T06:20:50+06:00 +author: + name: BernatBC + image: images/author/bernatbc.png menu: sidebar: name: Translating Posts @@ -9,4 +12,20 @@ menu: weight: 520 --- -## Coming soon....... +This theme has built-in support for multiple language. + +Before starting the post translation, make sure that you have enabled the language to your site. If that's not the case, you can follow the section `Add the language to the site` from the guide [How to Translate Site Data](/posts/translation/site-data/). + +## Creating the post + +Once you have your desired language added to your website, know you can translate posts to that language. We're going to assume that you want to translate an existing post. + +### Create the index file + +The first step is to locate the `index.md` file from the post that you want to translate. Then you have to create a file in the same directory (or you can just copy the `index.md` file), and name it `index..md`, where `` is the language code that you can find in the language table in [How to Translate Site Data](/posts/translation/site-data/). + +### Translate the post + +Now, you can start translating the post, the same way as you write a new post. + +> INFO: If you're dealing with internal references, you'll need to add the prefix `/` in front of your relative path. For example, if you want to create a link that is pointing to `/posts/translation/site-data/`, the link for the translated post will be `//posts/translation/site-data/`. diff --git a/content/posts/translation/new-language/hero.jpg b/content/posts/translation/new-language/hero.jpg new file mode 100644 index 00000000..1354c472 Binary files /dev/null and b/content/posts/translation/new-language/hero.jpg differ diff --git a/content/posts/translation/new-language/index.es.md b/content/posts/translation/new-language/index.es.md new file mode 100644 index 00000000..7be882a2 --- /dev/null +++ b/content/posts/translation/new-language/index.es.md @@ -0,0 +1,162 @@ +--- +title: "Cómo añadir un idioma sin soporte" +date: 2024-01-15T06:20:50+06:00 +author: + name: BernatBC + image: images/author/bernatbc.png +menu: + sidebar: + name: Añadiendo un nuevo idioma + identifier: new-language + parent: translation + weight: 510 +--- + +Si desea traducir a un idioma si soporte, puede traducir los elementos de la interfaz de usuario. + +## Crea el archivo `i18n` + +Para haerlo, debes crear el directorio `i18n` dentro de la raíz del sitio, el directorio dónde puede encontrar el archivo `config.yaml`, y directorios como `data`, `content`, etc. + +Luego, puedes crear el archivo `.toml` dentro del directorio `i18n`. En este [directorio](https://github.com/hugo-toha/hugo-toha.github.io/tree/gh-pages/flags/1x1) puedes encontrar todos los códigos de idiomas con las banderas que aparecerán junto a ese idioma. + +## Traduce los elementos de la interfaz + +Dentro del nuevo archivo, simplemente copia el siguiente contenido, y sustituye el contenido entre comillas con el nombre en tu idioma deseado. + +{{< alert type="warning" >}} +Si el contenido de abajo es obsoleto, puedes copiar el conteindo del archivo [en](https://github.com/hugo-toha/toha/blob/main/i18n/en.toml). +{{< /alert >}} + +```toml +# More documentation here: https://github.com/nicksnyder/go-i18n +[home] +other = "Home" + +[posts] +other = "Posts" + +[toc_heading] +other = "Table of Contents" + +[tags] +other = "Tags" + +[categories] +other = "Categories" + +[at] +other = "at" + +[resume] +other = "My resume" + +[navigation] +other = "Navigation" + +[contact_me] +other = "Contact me:" + +[email] +other = "Email" + +[phone] +other = "Phone" + +[newsletter_text] +other = "Stay up to date with email notification" + +[newsletter_input_placeholder] +other = "Enter email" + +[newsletter_warning] +other = "By entering your email address, you agree to receive the newsletter of this website." + +[submit] +other = "Submit" + +[hugoAttributionText] +other = "Powered by" + +[prev] +other = "Prev" + +[next] +other = "Next" + +[share_on] +other = "Share on" + +[improve_this_page] +other = "Improve this page" + +[out_of] +other = "out of" + +[publications] +other = "Publications" + +[taken_courses] +other = "Taken Courses" + +[course_name] +other = "Course Name" + +[total_credit] +other = "Total Credit" + +[obtained_credit] +other = "Obtained Credit" + +[extracurricular_activities] +other = "Extracurricular Activities" + +[show_more] +other = "Show More" + +[show_less] +other = "Show Less" + +[responsibilities] +other = "Responsibilities:" + +[present] +other = "Present" + +[comments_javascript] +other = "Please enable JavaScript to view the" + +[comments_by] +other = "comments powered by" + +[read] +other = "Read" + +[project_star] +other = "Star" + +[project_details] +other = "Details" + +[err_404] +other = "The page you are looking for is not there yet." + +[more] +other = "More" + +[view_certificate] +other = "View Certificate" + +[notes] +other = "Notes" + +[disclaimer_text] +other = "Liability Notice" + +[search] +other = "Search" + +[minute] +one = "minute" +other = "minutes" +``` diff --git a/content/posts/translation/new-language/index.md b/content/posts/translation/new-language/index.md new file mode 100644 index 00000000..77099796 --- /dev/null +++ b/content/posts/translation/new-language/index.md @@ -0,0 +1,162 @@ +--- +title: "How to add an unsupported language" +date: 2024-01-15T06:20:50+06:00 +author: + name: BernatBC + image: images/author/bernatbc.png +menu: + sidebar: + name: Adding new language + identifier: new-language + parent: translation + weight: 510 +--- + +If you want to translate to an unsupported language, you can translate the UI elements. + +## Create an `i18n` file + +To do so, you have to create the `i18n` diretory inside the root of the site, the directory where you can find the `config.yaml` file, and directories like `data`, `content`, etc. + +Afterwards, you can create the file `.toml` into the `i18n` directory. In this [directory](https://github.com/hugo-toha/hugo-toha.github.io/tree/gh-pages/flags/1x1), you can find all language codes with the flag that will appear with that code. + +## Translate the UI elements + +Inside the new file, just copy the following content, and replace the content between the quotation marks with the name in your desired language. + +{{< alert type="warning" >}} +If the content below gets obsolete, you can copy the contents from the [en](https://github.com/hugo-toha/toha/blob/main/i18n/en.toml) file. +{{< /alert >}} + +```toml +# More documentation here: https://github.com/nicksnyder/go-i18n +[home] +other = "Home" + +[posts] +other = "Posts" + +[toc_heading] +other = "Table of Contents" + +[tags] +other = "Tags" + +[categories] +other = "Categories" + +[at] +other = "at" + +[resume] +other = "My resume" + +[navigation] +other = "Navigation" + +[contact_me] +other = "Contact me:" + +[email] +other = "Email" + +[phone] +other = "Phone" + +[newsletter_text] +other = "Stay up to date with email notification" + +[newsletter_input_placeholder] +other = "Enter email" + +[newsletter_warning] +other = "By entering your email address, you agree to receive the newsletter of this website." + +[submit] +other = "Submit" + +[hugoAttributionText] +other = "Powered by" + +[prev] +other = "Prev" + +[next] +other = "Next" + +[share_on] +other = "Share on" + +[improve_this_page] +other = "Improve this page" + +[out_of] +other = "out of" + +[publications] +other = "Publications" + +[taken_courses] +other = "Taken Courses" + +[course_name] +other = "Course Name" + +[total_credit] +other = "Total Credit" + +[obtained_credit] +other = "Obtained Credit" + +[extracurricular_activities] +other = "Extracurricular Activities" + +[show_more] +other = "Show More" + +[show_less] +other = "Show Less" + +[responsibilities] +other = "Responsibilities:" + +[present] +other = "Present" + +[comments_javascript] +other = "Please enable JavaScript to view the" + +[comments_by] +other = "comments powered by" + +[read] +other = "Read" + +[project_star] +other = "Star" + +[project_details] +other = "Details" + +[err_404] +other = "The page you are looking for is not there yet." + +[more] +other = "More" + +[view_certificate] +other = "View Certificate" + +[notes] +other = "Notes" + +[disclaimer_text] +other = "Liability Notice" + +[search] +other = "Search" + +[minute] +one = "minute" +other = "minutes" +``` diff --git a/content/posts/translation/site-data/hero.jpg b/content/posts/translation/site-data/hero.jpg new file mode 100644 index 00000000..1354c472 Binary files /dev/null and b/content/posts/translation/site-data/hero.jpg differ diff --git a/content/posts/translation/site-data/index.es.md b/content/posts/translation/site-data/index.es.md index 05304219..584315be 100644 --- a/content/posts/translation/site-data/index.es.md +++ b/content/posts/translation/site-data/index.es.md @@ -1,6 +1,9 @@ --- title: "Como traducir los datos de la página de inicio" date: 2020-06-07T06:20:50+06:00 +author: + name: BernatBC + image: images/author/bernatbc.png menu: sidebar: name: Traduciendo la página de inicio @@ -9,4 +12,80 @@ menu: weight: 510 --- -## Próximamente....... +Este tema tiene soporte integrado para varios idiomas. + +## Añade el idioma en el sitio + +Añadiendo el idioma a su sitio traducirá la interfaz de usuario a ese idioma (por ejemplo, los botones, las barras de navegación, etc.). + +### Obtener el código del idioma + +Para traducir su sitio, necesitará el código de su idioma. La siguiente tabla contiene los idiomas soportados junto con sus códigos: + +| Idioma | Código | +|----------------------|-------------------| +| English | `en` / none | +| বাংলা | `bn` | +| Français | `fr` | +| Indonesian | `id` | +| Deutsch | `de` | +| Español | `es` | +| 简体中文 | `zh-cn` / `zh-tw` | +| हिन्दी | `hi` | +| Italiano | `it` | +| 日本語 | `jp` | +| 한국어 | `ko` | +| русский | `ru` | +| suomi | `fi` | +| Tiếng Việt | `vn` | +| Turkish | `tr` | +| Arabic (العربية) | `ar` | +| Português Europeu | `pt-pt` | +| Català | `ad` | +| Português Brasileiro | `pt-br` | +| Dutch | `nl` | + +
+ +Para una lista completa de los idiomas soportados, por favor, consulte el archivo README de [toha repository](https://github.com/hugo-toha/toha). + +Si el idioma al que desea traducir el contenido no está disponible, consulte la guía [Cómo añadir un idioma sin soporte](/es/posts/translation/new-language/). + +### Añade el idioma a `config.yaml` + +Después de conocer el código para el idioma al que desea traducir su sitio, abra el archivo `config.yaml` y, debajo de la sección `language`, añade lo siguiente: + +```yaml +languages: + en: + languageName: English + weight: 1 + : + languageName: + weight: 2 # Puedes establecer el orden de los idiomas con este valor + +``` + +Por ejemplo, si deseas establecer el francés como segundo idioma, la sección debería ser similar a: + +```yaml +languages: + en: + languageName: English + weight: 1 + fr: + languageName: Français + weight: 2 # Puedes establecer el orden de los idiomas con este valor + +``` + +## Traduciendo la página de inicio + +Puedes traducir la página de inicio creando un nuevo directorio dentro de `data`. El nombre del nuevo directorio debería ser ``. Por ejemplo, si queremos traducirlo al francés, crearemos el directorio `fr` dentro de `data`. + +Afterwards you can create your usual data file like `about.yaml` or `education.yaml` files, keeping the same file structure and maintaining the same file names. Inside those files, you can just translate the content of the fields into your desired language. +Luego, puede crear sus archivos de datos habituales, como `about.yaml` o `education.yaml`, manteniendo la misma estructura y los mismos nombres de archivos. Dentro de esos archivos, puede traducir el contenido de los campos al idioma que desee. + +## A continuación + +Puedes consultar la siguiente guía [Como traducir las publicaciones](/es/posts/translation/content/). \ No newline at end of file diff --git a/content/posts/translation/site-data/index.md b/content/posts/translation/site-data/index.md index 91625803..213fad26 100644 --- a/content/posts/translation/site-data/index.md +++ b/content/posts/translation/site-data/index.md @@ -1,6 +1,9 @@ --- title: "How to Translate Site Data" -date: 2020-06-07T06:20:50+06:00 +date: 2024-01-15T06:20:50+06:00 +author: + name: BernatBC + image: images/author/bernatbc.png menu: sidebar: name: Translating Homepage @@ -9,4 +12,79 @@ menu: weight: 510 --- -## Coming soon....... +This theme has built-in support for multiple language. + +## Add the language to the site + +Adding the language to your site will translate the UI to that language (e.g. the buttons, the nav bars, etc.). + +### Get language code + +In order to translate your site, you will need the code from your language. The following table contains the supported languages algonside its codes: + +| Languages | Code | +|----------------------|-------------------| +| English | `en` / none | +| বাংলা | `bn` | +| Français | `fr` | +| Indonesian | `id` | +| Deutsch | `de` | +| Español | `es` | +| 简体中文 | `zh-cn` / `zh-tw` | +| हिन्दी | `hi` | +| Italiano | `it` | +| 日本語 | `jp` | +| 한국어 | `ko` | +| русский | `ru` | +| suomi | `fi` | +| Tiếng Việt | `vn` | +| Turkish | `tr` | +| Arabic (العربية) | `ar` | +| Português Europeu | `pt-pt` | +| Català | `ad` | +| Português Brasileiro | `pt-br` | +| Dutch | `nl` | + +
+ +For a complete list of the supported languages, please check the README file from the [toha repository](https://github.com/hugo-toha/toha). + +If the language you desire to translate the content to is not available, please check the guide [How to add an unsupported language](/posts/translation/new-language/). + +### Add the language into `config.yaml` + +After you know what's the code for the language you wish to translate your site, open `config.yaml` file, and under the `languages` section add the following: + +```yaml +languages: + en: + languageName: English + weight: 1 + : + languageName: + weight: 2 # You can set the language order with this value + +``` + +For example, if we want to set `Français` as the new language, the section would look similar to: + +```yaml +languages: + en: + languageName: English + weight: 1 + fr: + languageName: Français + weight: 2 # You can set the language order with this value + +``` + +## Translating the Main Page + +You can translate the main page by creating a new directory into `data` directory. The name of the new directory should be ``. For example, if we want to translate it to french, we would create the `fr` directory into `data` directory. + +Afterwards you can create your usual data file like `about.yaml` or `education.yaml` files, keeping the same file structure and maintaining the same file names. Inside those files, you can just translate the content of the fields into your desired language. + +## Next up + +You can check the following guide [How to Translate Posts](/posts/translation/content/). \ No newline at end of file