Skip to content
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

Release 1.1.13 #182

Merged
merged 10 commits into from
Jul 26, 2024
12 changes: 6 additions & 6 deletions .github/workflows/build-installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ jobs:
- name: Notarize
run: |
DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg')
npm install -g notarize-cli
notarize-cli \
--file="$DMG_FILE" \
--bundle-id net.chia.climate-explorer-ui \
--username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}"
xcrun notarytool submit \
--wait \
--apple-id "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" \
--team-id "${{ secrets.APPLE_TEAM_ID }}" \
"$DMG_FILE"

- name: Upload Mac Installer
uses: actions/upload-artifact@v3
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "climateexplorerui",
"version": "1.1.12",
"version": "1.1.13",
"private": true,
"author": "Chia Network Inc. <[email protected]>",
"description": "User interface for the Chia Climate Explorer application",
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AppNavigator } from './navigation';
import theme from './theme';

import { IndeterminateProgressOverlay } from './components';
import { LocaleChangeListener } from './components/blocks/LocaleChangeListener';

const App = () => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -46,6 +47,7 @@ const App = () => {
defaultLocale="en"
messages={translationTokens.default}
>
<LocaleChangeListener />
<AppNavigator />
</IntlProvider>
</ThemeProvider>
Expand Down
29 changes: 29 additions & 0 deletions src/components/blocks/LocaleChangeListener.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { setLocale } from '../../store/actions/appActions';

const LocaleChangeListener = () => {
const dispatch = useDispatch();

useEffect(() => {
// Function to handle the message event
const handleMessage = event => {
if (event?.data?.changeLocale) {
dispatch(setLocale(event?.data?.changeLocale));
}
};

// Add the event listener
window.addEventListener('message', handleMessage, false);

// Return a function that will be called when the component unmounts
return () => {
// Remove the event listener
window.removeEventListener('message', handleMessage, false);
};
}, []);

return <></>;
};

export { LocaleChangeListener };
18 changes: 17 additions & 1 deletion src/translations/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
import * as en from './tokens/en-US.json';
import * as es from './tokens/es.json';
import * as fr from './tokens/fr.json';
import * as de from './tokens/de.json';
import * as cn from './tokens/zh-cn.json';

const LANGUAGE_CODES = Object.freeze({
ENGLISH: 'en-US',
PAK: 'pk-PK',
SPANISH: 'es-ES',
FRENCH: 'fr-FR',
GERMAN: 'de-DE',
CHINESE: 'cn',
});

const loadLocaleData = locale => {
switch (locale) {
case LANGUAGE_CODES.ENGLISH_US:
case LANGUAGE_CODES.SPANISH:
return es;
case LANGUAGE_CODES.FRENCH:
return fr;
case LANGUAGE_CODES.GERMAN:
return de;
case LANGUAGE_CODES.CHINESE:
return cn;
case LANGUAGE_CODES.ENGLISH:
default:
return en;
Expand Down
27 changes: 27 additions & 0 deletions src/translations/tokens/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"climate-explorer": "Klimaforscher",
"hello-world": "Willkommen im Climate Explorer",
"ok": "OK",
"search": "Suchen",
"select": "Wählen",
"filters": "Filter",
"network-error": "Netzwerkfehler",
"there-is-a-connection-error": "Es gibt einen Verbindungsfehler",
"something-went-wrong": "Hoppla! Etwas ist schiefgelaufen",
"success": "Erfolg",
"no-explorer-data": "Es sind keine Explorer -Daten verfügbar.",
"explorer-data-not-loaded": "Explorer -Daten konnten nicht geladen werden.",
"actions": "Aktionen",
"carbon-token-explorer": "Carbon Token Explorer",
"detailed-view": "Detaillierte Ansicht",
"cancel": "Stornieren",
"connect-to-cw": "Verbinden",
"connect": "Verbinden",
"server-address": "Serveradresse",
"api-key": "API-Schlüssel",
"import-home-org": "Home importieren",
"connect-to-remote": "Verbindung zu Fern eine Verbindung hergestellt",
"update-home-org": "Home Update",
"add-valid-server-address": "Gültige Serveradresse hinzufügen",
"import": "Verbinden"
}
27 changes: 27 additions & 0 deletions src/translations/tokens/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"climate-explorer": "Explorador climático",
"hello-world": "Bienvenido a Climate Explorer",
"ok": "De acuerdo",
"search": "Buscar",
"select": "Seleccionar",
"filters": "Filtros",
"network-error": "Error de red",
"there-is-a-connection-error": "Hay un error de conexión",
"something-went-wrong": "Huy! Algo salió mal",
"success": "Éxito",
"no-explorer-data": "No hay datos de Explorer disponibles.",
"explorer-data-not-loaded": "Los datos del explorador no se pudieron cargar.",
"actions": "Comportamiento",
"carbon-token-explorer": "Explorador de tokens de carbono",
"detailed-view": "Vista detallada",
"cancel": "Cancelar",
"connect-to-cw": "Conectar",
"connect": "Conectar",
"server-address": "Dirección del servidor",
"api-key": "Clave API",
"import-home-org": "Importar en casa",
"connect-to-remote": "Conectarse a remoto",
"update-home-org": "Actualización de inicio",
"add-valid-server-address": "Agregar dirección de servidor válida",
"import": "Conectar"
}
27 changes: 27 additions & 0 deletions src/translations/tokens/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"climate-explorer": "Explorateur de climat",
"hello-world": "Bienvenue à Climate Explorer",
"ok": "D'accord",
"search": "Recherche",
"select": "Sélectionner",
"filters": "Filtres",
"network-error": "Erreur de réseau",
"there-is-a-connection-error": "Il y a une erreur de connexion",
"something-went-wrong": "Oups, quelque chose s'est mal passé",
"success": "Succès",
"no-explorer-data": "Aucune donnée d'explorateur n'est disponible.",
"explorer-data-not-loaded": "Les données de l'explorateur n'ont pas pu être chargées.",
"actions": "Actions",
"carbon-token-explorer": "Explorateur de jeton de carbone",
"detailed-view": "Vue détaillée",
"cancel": "Annuler",
"connect-to-cw": "Connecter",
"connect": "Connecter",
"server-address": "Adresse du serveur",
"api-key": "Clé API",
"import-home-org": "Importer à la maison",
"connect-to-remote": "Connectez-vous à la distance",
"update-home-org": "Mise à jour domestique",
"add-valid-server-address": "Ajouter l'adresse du serveur valide",
"import": "Connecter"
}
27 changes: 27 additions & 0 deletions src/translations/tokens/zh-cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"climate-explorer": "气候探险家",
"hello-world": "欢迎来到气候探险家",
"ok": "好的",
"search": "搜索",
"select": "选择",
"filters": "过滤器",
"network-error": "网络错误",
"there-is-a-connection-error": "有连接错误",
"something-went-wrong": "哎呀!出事了",
"success": "成功",
"no-explorer-data": "没有可用的探险家数据。",
"explorer-data-not-loaded": "无法加载资源管理器数据。",
"actions": "动作",
"carbon-token-explorer": "碳令牌探险家",
"detailed-view": "详细的视图",
"cancel": "取消",
"connect-to-cw": "连接",
"connect": "连接",
"server-address": "服务器地址",
"api-key": "API键",
"import-home-org": "进口房屋",
"connect-to-remote": "连接到遥控器",
"update-home-org": "家庭更新",
"add-valid-server-address": "添加有效的服务器地址",
"import": "连接"
}
Loading