Skip to content

Commit

Permalink
feat: translate
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed Mar 14, 2023
1 parent 5a91595 commit cb44607
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 141 deletions.
123 changes: 63 additions & 60 deletions src/browser/locale/messages.xlf

Large diffs are not rendered by default.

134 changes: 68 additions & 66 deletions src/browser/locale/messages.zh.xlf

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="p-[20px]">
<header class="flex justify-between">
<div class="mb-[15px] flex">
<b class="mr-[14px] text-[18px] truncate max-w-[500px]" i18n>{{ title }}</b>
<b class="mr-[14px] text-[18px] truncate max-w-[500px]">{{ title }}</b>
</div>
<div class="flex">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ const authInMap = {
<a href="https://docs.postcat.com/docs/global-variable.html" target="_blank" rel="noopener noreferrer">variables</a>
</div>
</ng-template>
</ng-container>
<ng-container *ngIf="model.authInfo && schemaObj">
<eo-schema-form #schemaForm [model]="model.authInfo" [configuration]="schemaObj" (valueChanges)="handleValueChanges($event)" />
<ng-container *ngIf="model.authInfo && schemaObj">
<eo-schema-form #schemaForm [model]="model.authInfo" [configuration]="schemaObj" (valueChanges)="handleValueChanges($event)" />
</ng-container>
</ng-container>
</div>
</ng-container>
Expand Down Expand Up @@ -130,9 +129,11 @@ export class AuthorizationExtensionFormComponent implements OnChanges {
.get()
.pipe(takeUntil(this.destroy$))
.subscribe((inArg: Message) => {
if (inArg.type === 'extensionsChange') {
this.initExtensions();
}
if (inArg.type !== 'extensionsChange') return;
const extension = inArg.data.extension;
if (!extension?.features?.authAPI) return;
this.initExtensions();
this.updateSchema(this.authType);
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nz-result *ngIf="web.isWeb" nzStatus="warning" [nzTitle]="titleTips">
<div nz-result-extra>
<button eo-ng-button *ngIf="isInstalledClient" nzType="primary" (click)="jumpToClient()" trace traceID="open_client" i18n>{{
<button eo-ng-button *ngIf="isInstalledClient" nzType="primary" (click)="jumpToClient()" trace traceID="open_client">{{
btnTitle
}}</button>
<pc-download-client btnType="button" *ngIf="!isInstalledClient"></pc-download-client>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const compMap = {
</nz-form-label>
</ng-container>
<nz-form-control i18n-nzErrorTip nzErrorTip="Please Enter {{ properties[field]?.label }}" class="form-control">
<nz-form-control nzErrorTip="{{ placeholderTips }} {{ properties[field]?.label }}" class="form-control">
<!-- Description -->
<div *ngIf="properties[field]?.type !== 'boolean' && properties[field]?.description" class="text-[12px] mb-[8px] text-tips">
{{ properties[field]?.description }}
Expand All @@ -53,8 +53,7 @@ const compMap = {
eo-ng-input
id="{{ field }}"
[disabled]="properties[field]?.disabled"
i18n-placeholder
placeholder="{{ properties[field]?.placeholder ?? 'Please Enter ' + (properties[field]?.label || '') }}"
placeholder="{{ properties[field]?.placeholder ?? placeholderTips + (properties[field]?.label || '') }}"
formControlName="{{ field }}"
[(ngModel)]="model[field]"
/>
Expand All @@ -67,8 +66,7 @@ const compMap = {
eo-ng-input
id="{{ field }}"
[disabled]="properties[field]?.disabled"
i18n-placeholder
placeholder="{{ properties[field]?.placeholder ?? 'Please Enter ' + (properties[field]?.label || '') }}"
placeholder="{{ properties[field]?.placeholder ?? placeholderTips + (properties[field]?.label || '') }}"
formControlName="{{ field }}"
[rows]="properties[field].ui.rows ?? 4"
[(ngModel)]="model[field]"
Expand Down Expand Up @@ -150,7 +148,7 @@ export class EoSchemaFormComponent implements OnChanges {
properties = {};
compMap = compMap;
isInited = true;

placeholderTips = $localize`Please enter `;
constructor(private fb: FormBuilder) {
this.validateForm = this.fb.group({});
this.initEmitter();
Expand Down

0 comments on commit cb44607

Please sign in to comment.