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

Add full JSDoc context and types to translation global #196

Merged
merged 2 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locale/template/translation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var translation = {
export const translation_template = {
// This document is to be used as a template as all the base code is in English
// Basic HTML tags are allowed such as <b><i> etc. All data is sanitized https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML

Expand Down
9 changes: 8 additions & 1 deletion scripts/i18n.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { translation_template } from '../locale/template/translation.js';
import { en_translation } from '../locale/en/translation.js';
import { pt_br_translation } from '../locale/pt-br/translation.js';
import { pt_pt_translation } from '../locale/pt-pt/translation.js';
Expand All @@ -14,7 +15,14 @@ import { masterKey } from './wallet.js';
import { getNetwork } from './network.js';
import { cReceiveType, guiToggleReceiveType } from './contacts-book.js';

/**
* @type {translation_template}
*/
export const ALERTS = {};

/**
* @type {translation_template}
*/
export let translation = {};

// TRANSLATION
Expand Down Expand Up @@ -99,7 +107,6 @@ export function tr(message, variables) {
/**
* Translates all static HTML based on the `data-i18n` tag
* @param {Array} i18nLangs
*
*/
export function translateStaticHTML(i18nLangs) {
if (!i18nLangs) return;
Expand Down