Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
feat: i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
myml committed Apr 8, 2019
1 parent 4ae4a4c commit 756b99e
Show file tree
Hide file tree
Showing 13 changed files with 440 additions and 389 deletions.
7 changes: 3 additions & 4 deletions src/app/deepin_appstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ int main(int argc, char **argv)
app.loadTranslator();
app.setApplicationDisplayName(QObject::tr("Deepin Store"));
app.setApplicationDescription(QObject::tr(
"Deepin Store is an Appstore with quality and rich applications. "
"Popular recommendation, new updated apps and hot topics are available. "
"It supports one click to download, install, update, "
"uninstall and so on."));
"Deepin Store is an App Store with diverse and quality applications. "
"It features popular recommendations, newly updated apps and hot topics, and supports one-click installation, "
"updating and uninstalling."));
app.setApplicationAcknowledgementPage(
"https://www.deepin.org/acknowledgments/deepin-appstore/");

Expand Down
6 changes: 3 additions & 3 deletions src/ui/widgets/title_bar_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void TitleBarMenu::initActions()

QMenu *region_menu = nullptr;
if (SettingsManager::instance()->allowSwitchRegion()) {
region_menu = this->addMenu(QObject::tr("Select Region"));
region_menu = this->addMenu(QObject::tr("Select region"));
} else {
region_menu = new QMenu();
connect(this, &QObject::destroyed,
Expand All @@ -96,11 +96,11 @@ void TitleBarMenu::initActions()
connect(region_group_, &QActionGroup::triggered,
this, &TitleBarMenu::onRegionGroupTriggered);

this->addAction(QObject::tr("Clear Cache"),
this->addAction(QObject::tr("Clear cache"),
this, &TitleBarMenu::clearCacheRequested);

theme_name_ = SettingsManager::instance()->getThemeName();
switch_theme_action_ = this->addAction(QObject::tr("Dark Theme"));
switch_theme_action_ = this->addAction(QObject::tr("Dark theme"));
switch_theme_action_->setCheckable(true);
connect(switch_theme_action_, &QAction::triggered,
this, &TitleBarMenu::onThemeActionTriggered);
Expand Down
83 changes: 44 additions & 39 deletions src/web/src/app/components/notify/notify.component.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
<div class="notify"
*ngIf="notify$|async as $notify"
@flyInOut>
<span class="succeed"
*ngIf="$notify.type===NotifyType.Bulletin;else $others"
i18n>Announcement:{{$notify.content}}</span>
<ng-template #$others>
<ng-container [ngSwitch]="$notify.status">
<ng-container *ngSwitchCase="NotifyStatus.Success">
<img src="/assets/icons/ok.svg">
<span class="succeed"
[ngSwitch]="$notify.type">
<ng-container *ngSwitchCase="NotifyType.Reminder"
i18n>Urge successfully</ng-container>
<ng-container *ngSwitchCase="NotifyType.Clear"
i18n>Cache was cleared successfully</ng-container>
<ng-container *ngSwitchCase="NotifyType.Recommend"
i18n>Submit succeeded</ng-container>
</span>
</ng-container>
<ng-container *ngSwitchCase="NotifyStatus.Error">
<img src="/assets/icons/failed.svg">
<span class="failed"
[ngSwitch]="$notify.type">
<ng-container *ngSwitchCase="NotifyType.Reminder"
i18n>Urge failed</ng-container>
<ng-container *ngSwitchCase="NotifyType.Clear"
i18n>Failed to clear cache</ng-container>
<ng-container *ngSwitchCase="NotifyType.Recommend"
i18n>Submit failed</ng-container>
<ng-container *ngSwitchCase="NotifyType.JobError">{{$notify.content}}</ng-container>
</span>
</ng-container>
</ng-container>
</ng-template>
<img class="close"
(click)="close()"
*ngIf="!$notify.delay">
</div>
<div class="notify" *ngIf="(notify$ | async) as $notify" @flyInOut>
<span
class="succeed"
*ngIf="$notify.type === NotifyType.Bulletin; else $others"
i18n
>Announcement:{{ $notify.content }}</span
>
<ng-template #$others>
<ng-container [ngSwitch]="$notify.status">
<ng-container *ngSwitchCase="NotifyStatus.Success">
<img src="/assets/icons/ok.svg" />
<span class="succeed" [ngSwitch]="$notify.type">
<ng-container *ngSwitchCase="NotifyType.Reminder" i18n
>Request successful</ng-container
>
<ng-container *ngSwitchCase="NotifyType.Clear" i18n
>Cache cleared</ng-container
>
<ng-container *ngSwitchCase="NotifyType.Recommend" i18n
>Submit successful</ng-container
>
</span>
</ng-container>
<ng-container *ngSwitchCase="NotifyStatus.Error">
<img src="/assets/icons/failed.svg" />
<span class="failed" [ngSwitch]="$notify.type">
<ng-container *ngSwitchCase="NotifyType.Reminder" i18n
>Request failed</ng-container
>
<ng-container *ngSwitchCase="NotifyType.Clear" i18n
>Failed to clear cache</ng-container
>
<ng-container *ngSwitchCase="NotifyType.Recommend" i18n
>Submit failed</ng-container
>
<ng-container *ngSwitchCase="NotifyType.JobError">{{
$notify.content
}}</ng-container>
</span>
</ng-container>
</ng-container>
</ng-template>
<img class="close" (click)="close()" *ngIf="!$notify.delay" />
</div>
6 changes: 3 additions & 3 deletions src/web/src/app/components/recommend/recommend.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<form #myForm="ngForm">
<table *ngIf="myDialog.open">
<caption class="title">
<ng-container i18n>Recommend App</ng-container>
<ng-container i18n>Recommend app</ng-container>
</caption>
<tr>
<td>
Expand Down Expand Up @@ -95,7 +95,7 @@
>Official website cannot be empty</label
>
<label class="input-error" *ngIf="homePage.hasError('pattern')" i18n
>Official website is not a correct format</label
>Official website is not in a correct format</label
>
</div>
</td>
Expand Down Expand Up @@ -127,7 +127,7 @@
class="input-error"
*ngIf="downloadURL.hasError('pattern')"
i18n
>Download Site is not a correct format</label
>Download Site is not in a correct format</label
>
</div>
</td>
Expand Down
Loading

0 comments on commit 756b99e

Please sign in to comment.