Skip to content

Commit

Permalink
fix(translations): Translate embedded errors (apache#29782)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas authored Jul 31, 2024
1 parent 4c52ecc commit 0d62bb2
Show file tree
Hide file tree
Showing 21 changed files with 1,359 additions and 259 deletions.
5 changes: 5 additions & 0 deletions scripts/translations/babel_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../.. && pwd )"
LICENSE_TMP=$(mktemp)
Expand Down Expand Up @@ -47,6 +48,10 @@ pybabel extract \
--copyright-holder=Superset \
--project=Superset \
-k _ -k __ -k t -k tn:1,2 -k tct .

# Normalize .pot file
msgcat --sort-by-msgid --no-wrap --no-location superset/translations/messages.pot -o superset/translations/messages.pot

cat $LICENSE_TMP superset/translations/messages.pot > messages.pot.tmp \
&& mv messages.pot.tmp superset/translations/messages.pot

Expand Down
8 changes: 6 additions & 2 deletions superset-frontend/src/embedded/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ function showFailureMessage(message: string) {

if (!window.parent || window.parent === window) {
showFailureMessage(
'This page is intended to be embedded in an iframe, but it looks like that is not the case.',
t(
'This page is intended to be embedded in an iframe, but it looks like that is not the case.',
),
);
}

Expand Down Expand Up @@ -141,7 +143,9 @@ function start() {
// something is most likely wrong with the guest token
logging.error(err);
showFailureMessage(
'Something went wrong with embedded authentication. Check the dev console for details.',
t(
'Something went wrong with embedded authentication. Check the dev console for details.',
),
);
},
);
Expand Down
72 changes: 62 additions & 10 deletions superset/translations/ar/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Superset VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-07-03 14:07-0700\n"
"POT-Creation-Date: 2024-07-30 17:32-0600\n"
"PO-Revision-Date: 2024-04-18 20:58+0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: ar\n"
Expand Down Expand Up @@ -347,11 +347,10 @@ msgstr ""
msgid ""
"*%(name)s*\n"
"\n"
"%(description)s\n"
"\n"
"<%(url)s|Explore in Superset>\n"
" %(description)s\n"
"\n"
"%(table)s\n"
" Error: %(text)s\n"
" "
msgstr ""

#, python-format
Expand All @@ -360,7 +359,9 @@ msgid ""
"\n"
"%(description)s\n"
"\n"
"Error: %(text)s\n"
"<%(url)s|Explore in Superset>\n"
"\n"
"%(table)s\n"
msgstr ""

#, python-format
Expand Down Expand Up @@ -771,6 +772,12 @@ msgstr ""
msgid "Add Alert"
msgstr ""

msgid "Add BCC Recipients"
msgstr ""

msgid "Add CC Recipients"
msgstr ""

msgid "Add CSS template"
msgstr ""

Expand Down Expand Up @@ -1723,6 +1730,9 @@ msgstr ""
msgid "Axis descending"
msgstr ""

msgid "BCC recipients"
msgstr ""

msgid "BOOLEAN"
msgstr ""

Expand Down Expand Up @@ -1938,6 +1948,9 @@ msgstr ""
msgid "CANCEL"
msgstr ""

msgid "CC recipients"
msgstr ""

msgid "CREATE DATASET"
msgstr ""

Expand Down Expand Up @@ -2404,6 +2417,9 @@ msgstr ""
msgid "Choose one of the available databases from the panel on the left."
msgstr ""

msgid "Choose one of the available databases on the left panel."
msgstr ""

msgid "Choose sheet name"
msgstr ""

Expand Down Expand Up @@ -7236,9 +7252,6 @@ msgid ""
" or username."
msgstr ""

msgid "PDF download failed, please refresh and try again."
msgstr ""

msgid "Page length"
msgstr ""

Expand Down Expand Up @@ -7666,6 +7679,9 @@ msgstr ""
msgid "Primary y-axis format"
msgstr ""

msgid "Private Channels (Bot in channel)"
msgstr ""

msgid "Private Key"
msgstr ""

Expand Down Expand Up @@ -8760,6 +8776,10 @@ msgstr ""
msgid "Select catalog or type to search catalogs"
msgstr ""

#, fuzzy
msgid "Select channels"
msgstr "قواعد البيانات المدعومة"

msgid "Select chart"
msgstr ""

Expand Down Expand Up @@ -9019,6 +9039,9 @@ msgstr ""
msgid "Shift + Click to sort by multiple columns"
msgstr ""

msgid "Shift start date"
msgstr ""

msgid "Short description must be unique for this layer"
msgstr ""

Expand Down Expand Up @@ -9313,6 +9336,11 @@ msgstr ""
msgid "Some roles do not exist"
msgstr ""

msgid ""
"Something went wrong with embedded authentication. Check the dev console "
"for details."
msgstr ""

msgid "Something went wrong."
msgstr ""

Expand Down Expand Up @@ -10032,6 +10060,9 @@ msgstr ""
msgid "The database returned an unexpected error."
msgstr ""

msgid "The database that was used to generate this query could not be found"
msgstr ""

msgid "The database was deleted."
msgstr ""

Expand Down Expand Up @@ -10425,6 +10456,15 @@ msgstr ""
msgid "The schema was deleted or renamed in the database."
msgstr ""

msgid "The screenshot could not be downloaded. Please, try again later."
msgstr ""

msgid "The screenshot is being generated. Please, do not leave the page."
msgstr ""

msgid "The screenshot is now being downloaded."
msgstr ""

msgid "The size of each cell in meters"
msgstr ""

Expand Down Expand Up @@ -10579,7 +10619,7 @@ msgstr ""
msgid "There was an error fetching the favorite status: %s"
msgstr ""

msgid "There was an error fetching your recent activity:"
msgid "There was an error fetching the filtered charts and dashboards:"
msgstr ""

msgid "There was an error loading the catalogs"
Expand Down Expand Up @@ -10888,6 +10928,11 @@ msgstr ""
msgid "This option has been disabled by the administrator."
msgstr ""

msgid ""
"This page is intended to be embedded in an iframe, but it looks like that"
" is not the case."
msgstr ""

msgid ""
"This section allows you to configure how to use the slice\n"
" to generate annotations."
Expand Down Expand Up @@ -11411,6 +11456,10 @@ msgstr ""
msgid "Unknown MySQL server host \"%(hostname)s\"."
msgstr ""

#, python-format
msgid "Unknown OceanBase server host \"%(hostname)s\"."
msgstr ""

msgid "Unknown Presto Error"
msgstr ""

Expand Down Expand Up @@ -13053,6 +13102,9 @@ msgstr ""
msgid "in modal"
msgstr ""

msgid "invalid email"
msgstr ""

msgid "is expected to be a Mapbox URL"
msgstr ""

Expand Down
Loading

0 comments on commit 0d62bb2

Please sign in to comment.