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

Deploy to Prod #907

Merged
merged 19 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 18 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
10 changes: 8 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ module.exports = {
rules: {
"@typescript-eslint/no-var-requires": "off" // Disable this specific rule for CJS files
}
}
},
{
files: ['src/i18n/**/translations.ts'],
rules: {
"internal-rules/check-i18n-keys": "off" //Disabled so no warnings are presented everytime pre-commit is run
}
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
Expand All @@ -32,7 +38,7 @@ module.exports = {
jsx: true
}
},
plugins: ["@typescript-eslint", "solid", "import"],
plugins: ["@typescript-eslint", "solid", "import", "internal-rules"],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,61 @@ openssl base64 < <my-release-key.keystore> | tr -d '\n' | tee some_signing_key.j
- `SIGNING_KEY` <- the data from `<my-release-key.keystore>`
3. Change the `versionCode` and `versionName` on `app/build.gradle`
4. Commit and push.

## Translating

### Testing language keys

To check what keys are missing from your desired language:

```
just i18n $lang
```

### Adding new languages or keys

1. In `src/i18n/` locate your desired language folder or create one if one does not exist

- When creating a new language dir ensure it follows the ISO 639 2-letter standard

2. In this folder create a file called `translations.ts`, this is where the translation keys for your desired language will be located

3. Populate your translation file with a translation object where all of the keys will be located

If you want to add Japanese you will create a file `/src/i18n/jp/translations.ts` and populate it with keys like so:

```
export default {
common: {
continue: "続ける",
...
}
}
```

(You should compare your translations against the English language as all other languages are not the master and are likely deprecated)

4. Add your new translation file to the `/src/i18n/config.ts` so you can begin to see them in the app

```
import fa from "~/i18n/jp/translations.ts"

export const resources: {
...
jp: {
translations: jp
}
}
```

5. Add your language to the `Language` object in `/src/utils/languages.ts`. This will allow you to select the language via the language selector in the UI. If your desired language is set as your primary language in your browser it will be selected automatically

```
export const LANGUAGE_OPTIONS: Language[] = [
{
value: "日本語",
shortName: "jp"
},
```

6. That's it! You should now be able to see your translation keys populating the app in your desired language. When youre ready go ahead and open a PR to have you language merged for others!
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 50
versionName "0.5.9"
versionName "0.5.10"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.5.9;
MARKETING_VERSION = 1.5.10;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -387,7 +387,7 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.5.9;
MARKETING_VERSION = 1.5.10;
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>For scanning invoices</string>
<string>Mutiny uses the camera to scan QR codes of bitcoin addresses and lightning invoices.</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -50,8 +50,8 @@
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>nostr+walletconnect</string>
</array>
<array>
<string>nostr+walletconnect</string>
</array>
</dict>
</plist>
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ dev:
pre:
pnpm run pre-commit

i18n LANG:
#!/usr/bin/env bash
pnpm eslint-path "./src/i18n/{{LANG}}/translations.ts" --rule "{internal-rules/check-i18n-keys: warn}"

local:
pnpm install && pnpm link --global "@mutinywallet/mutiny-wasm"

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "mutiny-wallet",
"version": "0.5.9",
"version": "0.5.10",
"license": "MIT",
"packageManager": "[email protected]",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"check-types": "tsc --noemit",
"eslint": "eslint src",
"pre-commit": "pnpm run eslint && pnpm run check-types && pnpm run format",
"eslint-path": "eslint",
"check-i18n-keys": "eslint src/i18n/**/translations.ts --rule \"{internal-rules/check-i18n-keys: warn}\"",
"pre-commit": "pnpm eslint && pnpm run check-types && pnpm run format",
"format": "prettier --write \"{.,src/**,e2e/**}/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
"check-format": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\""
},
Expand All @@ -26,6 +28,7 @@
"eslint": "^8.52.0",
"eslint-import-resolver-typescript": "2.7.1",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-internal-rules": "file:tools/internal-rules",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-solid": "0.13.0",
"postcss": "^8.4.31",
Expand Down Expand Up @@ -55,7 +58,7 @@
"@kobalte/core": "^0.9.8",
"@kobalte/tailwindcss": "^0.5.0",
"@modular-forms/solid": "^0.18.1",
"@mutinywallet/mutiny-wasm": "0.5.9",
"@mutinywallet/mutiny-wasm": "0.5.10",
"@mutinywallet/waila-wasm": "^0.2.6",
"@solid-primitives/upload": "^0.0.111",
"@solidjs/meta": "^0.29.1",
Expand Down
28 changes: 24 additions & 4 deletions pnpm-lock.yaml

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

73 changes: 0 additions & 73 deletions src/components/BetaWarningModal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/ChooseLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function ChooseLanguage() {
const [_chooseLanguageForm, { Form, Field }] =
createForm<ChooseLanguageForm>({
initialValues: {
selectedLanguage: state.lang ?? ""
selectedLanguage: state.lang ?? i18n.language
},
validate: (values) => {
const errors: Record<string, string> = {};
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContactEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function ContactEditor(props: {
previous: location.pathname
}}
>
Import Nostr Contacts
{i18n.t("contacts.link_to_nostr_sync")}
</A>
</SimpleDialog>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContactViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ export function ContactViewer(props: {
intent="red"
onClick={() => setConfirmOpen(true)}
>
Delete
{i18n.t("contacts.delete")}
</Button>
<ConfirmDialog
open={confirmOpen()}
loading={false}
onConfirm={handleDelete}
onCancel={() => setConfirmOpen(false)}
>
Are you sure you want to delete this contact?
{i18n.t("contacts.confirm_delete")}
</ConfirmDialog>
</Match>
<Match when={!isEditing()}>
Expand Down
3 changes: 2 additions & 1 deletion src/components/MutinyPlusCta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export function MutinyPlusCta() {
>
<div class="flex justify-between">
<span>
Mutiny<span class="text-m-red">+</span>
{i18n.t("common.mutiny")}
<span class="text-m-red">+</span>
</span>
<img src={forward} alt="go" />
</div>
Expand Down
9 changes: 3 additions & 6 deletions src/components/ReceiveWarnings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ReceiveWarnings(props: {
return undefined;
};

const betaWarning = () => {
const sillyAmountWarning = () => {
const parsed = Number(props.amountSats);
if (isNaN(parsed)) {
return undefined;
Expand All @@ -59,16 +59,13 @@ export function ReceiveWarnings(props: {
if (parsed >= 2099999997690000) {
// If over 21 million bitcoin, warn that too much
return i18n.t("receive.amount_editable.more_than_21m");
} else if (parsed >= 4000000) {
// If over 4 million sats, warn that it's a beta bro
return i18n.t("receive.amount_editable.too_big_for_beta");
}
};

return (
<Switch>
<Match when={betaWarning()}>
<InfoBox accent="red">{betaWarning()}</InfoBox>
<Match when={sillyAmountWarning()}>
<InfoBox accent="red">{sillyAmountWarning()}</InfoBox>
</Match>
<Match when={warningText()}>
<InfoBox accent="blue">
Expand Down
1 change: 0 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * from "./ActivityItem";
export * from "./Amount";
export * from "./AmountEditable";
export * from "./BalanceBox";
export * from "./BetaWarningModal";
export * from "./ChooseCurrency";
export * from "./ChooseLanguage";
export * from "./ContactEditor";
Expand Down
Loading
Loading