Commit f0cf68ad authored by 神楽坂玲奈's avatar 神楽坂玲奈

i18n

parent a36baae1
# Mycard
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.4.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
download bin from CI
```
npm start
npm run start:electron
```
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
```
npm run build
npm run dist
```
## Further help
## i18n
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
```bash
pip install transifex-client
export TX_TOKEN
```
......@@ -84,13 +84,15 @@ autoUpdater.on('update-downloaded', (event) => {
updateWindow = new BrowserWindow({
width: 640,
height: 360,
autoHideMenuBar: true,
webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true }
});
updateWindow.loadFile('projects/update/update.html');
updateWindow.webContents.on('new-window', function (e, url) {
updateWindow.webContents.on('new-window', function(e, url) {
e.preventDefault();
shell.openExternal(url);
});
updateWindow.on('closed', function () {
updateWindow.on('closed', function() {
updateWindow = null;
});
ipcMain.on('update', (event, arg) => {
......@@ -133,7 +135,7 @@ function createAria2c() {
'--min-split-size=1M',
'--max-connection-per-server=10',
'--remove-control-file',
'--allow-overwrite',
'--allow-overwrite'
],
{ stdio: 'ignore' }
);
......@@ -153,8 +155,7 @@ async function createWindow() {
minHeight: 640,
frame: process.platform === 'darwin',
webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true, webviewTag: true },
// transparent: process.platform != 'darwin',
titleBarStyle: process.platform === 'darwin' ? 'hidden' : undefined,
titleBarStyle: process.platform === 'darwin' ? 'hidden' : undefined
});
// and load the index.html of the app.
......@@ -164,7 +165,7 @@ async function createWindow() {
mainWindow.loadFile(path.join('dist/mycard', getLocale(), 'index.html'));
}
mainWindow.webContents.on('new-window', function (e, url) {
mainWindow.webContents.on('new-window', function(e, url) {
e.preventDefault();
shell.openExternal(url);
});
......@@ -175,7 +176,7 @@ async function createWindow() {
}
// Emitted when the window is closed.
mainWindow.on('closed', function () {
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
......@@ -204,13 +205,13 @@ function createTray() {
type: 'normal',
click: () => {
mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show();
},
}
},
{
label: '退出',
type: 'normal',
click: app.quit,
},
click: app.quit
}
]);
tray.setToolTip('MyCard');
tray.setContextMenu(contextMenu);
......@@ -245,7 +246,7 @@ app.on('ready', async () => {
});
// Quit when all windows are closed.
app.on('window-all-closed', function () {
app.on('window-all-closed', function() {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
......@@ -253,7 +254,7 @@ app.on('window-all-closed', function () {
}
});
app.on('activate', function () {
app.on('activate', function() {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
......
{
"name": "mycard",
"version": "3.1.0",
"version": "3.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:electron": "electron .",
"build": "ng build --localize --base-href ..",
"watch": "ng build --localize --watch --configuration development",
"watch": "ng build --localize --base-href .. --watch --configuration development",
"pack": "electron-builder --dir",
"dist": "electron-builder"
"dist": "electron-builder",
"i18n:extract": "ng extract-i18n",
"i18n:upload": "tx push --source",
"i18n:translate": "open https://www.transifex.com/mycard/mycard/translate/#en_US/messages-xlf?q=translated%3Ano",
"i18n:download": "tx pull --all"
},
"main": "main.js",
"description": "萌卡客户端",
......@@ -80,7 +84,6 @@
"url": "https://cdn02.moecube.com:444/downloads"
}
],
"asar": false,
"files": [
"main.js",
"maotama.js",
......
......@@ -51,12 +51,7 @@
var app = new Vue({
el: '#vueApp',
created: function() {
let locale = localStorage.getItem('locale') || remote.app.getLocale();
if (locale.startsWith('zh-')) {
locale = 'zh-CN';
} else {
locale = 'en-US';
}
const locale = remote.app.getLocale().startsWith('zh') ? 'zh-CN' : 'en-US';
this.pageText = lang['update'][locale];
document.getElementById('title').innerHTML = this.pageText.pageTitle;
......
......@@ -7,7 +7,7 @@
<!--应用未购买-->
<div *ngIf="!currentApp.isBought()">
<button i18n type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#purchase-modal">{{currentApp.price.cny | currency:'CNY':true}} 购买</button>
<button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#purchase-modal">{{currentApp.price.cny | currency:'CNY':true}} <ng-container i18n>购买</ng-container></button>
<button i18n type="button" class="btn btn-secondary btn-sm" data-bs-toggle="modal" data-bs-target="#install-modal">安装试玩版</button>
<!--<button i18n (click)="updateInstallOption(currentApp)" type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#install-modal">我已经购买过</button>-->
......
......@@ -257,31 +257,31 @@
<button i18n class="btn btn-secondary dropdown-toggle btn-sm" type="button" id="watchDropdownMenuButton" aria-haspopup="true" aria-expanded="false">游戏模式</button>
<div class="dropdown-menu">
<h6 i18n class="dropdown-header">匹配</h6>
<label i18n class="form-check dropdown-item">
<label class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.athletic">
竞技匹配
<ng-container i18n>竞技匹配</ng-container>
</label>
<label i18n class="form-check dropdown-item">
<label class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.entertain">
娱乐匹配
<ng-container i18n>娱乐匹配</ng-container>
</label>
<h6 i18n class="dropdown-header">自定义游戏</h6>
<label i18n class="form-check dropdown-item">
<label class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.single">
单局模式
<ng-container i18n>单局模式</ng-container>
</label>
<label i18n class="form-check dropdown-item">
<label class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.match">
比赛模式
<ng-container i18n>比赛模式</ng-container>
</label>
<label i18n class="form-check dropdown-item">
<label class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.tag">
TAG
<ng-container i18n>TAG</ng-container>
</label>
<h6 i18n class="dropdown-header">单人模式</h6>
<label i18n class="form-check dropdown-item">
<label class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.windbot">
单人模式
<ng-container i18n>单人模式</ng-container>
</label>
</div>
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment