-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG - Fix i18n files and compilation for distribution #2042
Changes from 13 commits
42d479a
594a040
4cce361
e3c503e
6b95431
a911121
ed1decb
5866568
a686722
0c28478
773239f
9494167
0f3aa5c
85a8b51
75bbbc7
5999b61
6197020
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ file, and visible to localizers. For example: | |
|
||
{# L10n: Navigation button at the bottom of the page #} | ||
<button type="button"> | ||
{{- _("Next page") -}} | ||
{{- _('Next page') -}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit as we use single quotes in a lot of our localisable strings |
||
</button> | ||
|
||
.. _updating-localization-files: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,10 @@ | |
# Copyright (C) 2024 ORGANIZATION | ||
# This file is distributed under the same license as the PROJECT project. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. | ||
# | ||
# | ||
# Translators: | ||
# Cristhian Rivera, 2024 | ||
# Oriol Abril-Pla <[email protected]>, 2024 | ||
# | ||
msgid "" | ||
msgstr "" | ||
|
||
|
@@ -145,11 +144,10 @@ msgstr "Fosc" | |
msgid "System Settings" | ||
msgstr "Configuració del sistema" | ||
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:3 | ||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:4 | ||
#, python-format | ||
msgid "" | ||
"Built with the <a href=\"https://pydata-sphinx-" | ||
"theme.readthedocs.io/en/stable/index.html\">PyData Sphinx Theme</a> " | ||
"Built with the <a href=\"%(PST_url)s\">PyData Sphinx Theme</a> " | ||
"%(theme_version)s." | ||
msgstr "" | ||
"Construïda amb el <a href=\"https://pydata-sphinx-" | ||
|
@@ -191,3 +189,4 @@ msgstr "Navegació del lloc" | |
|
||
#~ msgid "light/dark" | ||
#~ msgstr "clar/fosc" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,18 @@ | |
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-11-18 12:43+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language: cs\n" | ||
"Language-Team: cs <[email protected]>\n" | ||
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Babel 2.16.0\n" | ||
|
||
#: docs/conf.py:109 | ||
msgid "Click to expand" | ||
|
@@ -141,11 +153,10 @@ msgstr "Tmavý" | |
msgid "System Settings" | ||
msgstr "" | ||
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:3 | ||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:4 | ||
#, python-format | ||
msgid "" | ||
"Built with the <a href=\"https://pydata-sphinx-" | ||
"theme.readthedocs.io/en/stable/index.html\">PyData Sphinx Theme</a> " | ||
"Built with the <a href=\"%(PST_url)s\">PyData Sphinx Theme</a> " | ||
"%(theme_version)s." | ||
msgstr "" | ||
"Vytvořeno pomocí <a href=\"https://pydata-sphinx-" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,26 @@ | |
# Copyright (C) 2024 ORGANIZATION | ||
# This file is distributed under the same license as the PROJECT project. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. | ||
# | ||
# | ||
# Translators: | ||
# Rambaud Pierrick <[email protected]>, 2023 | ||
# Cristhian Rivera, 2024 | ||
# Felipe Moreno, 2024 | ||
# Tania Allard, 2024 | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-11-18 12:43+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language: es\n" | ||
"Language-Team: es <[email protected]>\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Babel 2.16.0\n" | ||
|
||
#: docs/conf.py:109 | ||
msgid "Click to expand" | ||
|
@@ -42,8 +53,7 @@ msgstr "Error" | |
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/search.html:9 | ||
msgid "Please activate JavaScript to enable the search functionality." | ||
msgstr "" | ||
"Por favor, active JavaScript para habilitar la funcionalidad de búsqueda." | ||
msgstr "Por favor, active JavaScript para habilitar la funcionalidad de búsqueda." | ||
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/breadcrumbs.html:6 | ||
msgid "Breadcrumb" | ||
|
@@ -148,11 +158,10 @@ msgstr "Oscuro" | |
msgid "System Settings" | ||
msgstr "Sistema" | ||
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:3 | ||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:4 | ||
#, python-format | ||
msgid "" | ||
"Built with the <a href=\"https://pydata-sphinx-" | ||
"theme.readthedocs.io/en/stable/index.html\">PyData Sphinx Theme</a> " | ||
"Built with the <a href=\"%(PST_url)s\">PyData Sphinx Theme</a> " | ||
"%(theme_version)s." | ||
msgstr "" | ||
"Construido con el <a href=\"https://pydata-sphinx-" | ||
|
@@ -194,3 +203,4 @@ msgstr "Navegación del sitio" | |
|
||
#~ msgid "light/dark" | ||
#~ msgstr "claro/oscuro" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,10 @@ | |
# Copyright (C) 2024 ORGANIZATION | ||
# This file is distributed under the same license as the PROJECT project. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. | ||
# | ||
# | ||
# Translators: | ||
# Rambaud Pierrick <[email protected]>, 2024 | ||
# Denis Bitouzé <[email protected]>, 2024 | ||
# | ||
msgid "" | ||
msgstr "" | ||
|
||
|
@@ -145,11 +144,10 @@ msgstr "Sombre" | |
msgid "System Settings" | ||
msgstr "Paramètres système" | ||
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:3 | ||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:4 | ||
#, python-format | ||
msgid "" | ||
"Built with the <a href=\"https://pydata-sphinx-" | ||
"theme.readthedocs.io/en/stable/index.html\">PyData Sphinx Theme</a> " | ||
"Built with the <a href=\"%(PST_url)s\">PyData Sphinx Theme</a> " | ||
"%(theme_version)s." | ||
msgstr "" | ||
"Construit avec le <a href=\"https://pydata-sphinx-" | ||
|
@@ -191,3 +189,4 @@ msgstr "Navigation dans le site" | |
|
||
#~ msgid "light/dark" | ||
#~ msgstr "clair/sombre" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,12 @@ | |
# project. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. | ||
# | ||
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: pydata-sphinx-theme 0.16.0rc0\n" | ||
"Project-Id-Version: pydata-sphinx-theme 0.16.1.dev0\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-09-30 17:53+0100\n" | ||
"POT-Creation-Date: 2024-11-18 12:43+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -150,11 +151,10 @@ msgstr "" | |
msgid "System Settings" | ||
msgstr "" | ||
|
||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:3 | ||
#: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-version.html:4 | ||
#, python-format | ||
msgid "" | ||
"Built with the <a href=\"https://pydata-sphinx-" | ||
"theme.readthedocs.io/en/stable/index.html\">PyData Sphinx Theme</a> " | ||
"Built with the <a href=\"%(PST_url)s\">PyData Sphinx Theme</a> " | ||
"%(theme_version)s." | ||
msgstr "" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{# Displays the version of pydata-sphinx-theme used to build the documentation. #} | ||
<p class="theme-version"> | ||
{% trans theme_version=theme_version|e %}Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> {{ theme_version }}.{% endtrans %} | ||
<!-- # L10n: Setting the PST URL as an argument as this does not need to be localized --> | ||
{% trans trimmed theme_version=theme_version|e, PST_url="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html" %} | ||
Built with the <a href="{{ PST_url }}">PyData Sphinx Theme</a> {{ theme_version }}. | ||
{% endtrans %} | ||
</p> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,15 @@ const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); | |
const TerserPlugin = require("terser-webpack-plugin"); | ||
const dedent = require("dedent"); | ||
const { Compilation } = require("webpack"); | ||
const { exec } = require("child_process"); | ||
|
||
/******************************************************************************* | ||
* Paths for various assets (sources and destinations) | ||
*/ | ||
|
||
const scriptPath = resolve(__dirname, "src/pydata_sphinx_theme/assets/scripts"); | ||
const staticPath = resolve(__dirname, "src/pydata_sphinx_theme/theme/pydata_sphinx_theme/static"); | ||
const localePath = resolve(__dirname, "src/pydata_sphinx_theme/locale"); | ||
trallard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/******************************************************************************* | ||
* functions to load the assets in the html head | ||
|
@@ -96,8 +98,8 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({ | |
templateContent: macroTemplate, | ||
}); | ||
|
||
module.exports = { | ||
mode: "production", | ||
// webpack main configuration | ||
var config = { | ||
devtool: "source-map", | ||
entry: { | ||
"pydata-sphinx-theme": resolve(scriptPath, "pydata-sphinx-theme.js"), | ||
|
@@ -170,3 +172,21 @@ module.exports = { | |
topLevelAwait: true, | ||
}, | ||
}; | ||
|
||
module.exports = (env, argv) => { | ||
// since STB isolates the build, we need to compile the translations here for releases | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you provide a link in this code comment to more info? What does it mean that STB isolates the build? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Under the hood That means, when compiling assets from
When calling via
so if you compile the translation files first with
trallard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (argv.mode === 'production') { | ||
exec(`pybabel compile -d ${localePath} -D sphinx`, (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`Error: ${error.message}`); | ||
return; | ||
} | ||
if (stderr) { | ||
console.error(`stderr: ${stderr}`); | ||
trallard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return; | ||
} | ||
console.log(`stdout: ${stdout}`); | ||
}); | ||
} | ||
return config; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For whatever reason I had missed this when renaming to
compile-assets