Merge pull request #5301 from tsiegleauq/new-extract-function

Update translation extractor
This commit is contained in:
Emanuel Schütze 2020-04-06 17:52:16 +02:00 committed by GitHub
commit 42af962248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 16 additions and 24 deletions

View File

@ -22,7 +22,7 @@
"e2e": "ng e2e",
"licenses": "node src/crawler.js",
"compodoc": "./node_modules/.bin/compodoc --hideGenerator -p tsconfig.app.json -n 'OpenSlides Documentation' -d ../Compodoc -s -o -r",
"extract": "ngx-translate-extract -i ./src -o ./src/assets/i18n/template-en.pot --clean --sort --format pot -m _",
"extract": "ngx-translate-extract -i ./src -o ./src/assets/i18n/template-en.pot --clean --sort --format pot",
"po2json": "./node_modules/.bin/po2json -f mf src/assets/i18n/de.po src/assets/i18n/de.json && ./node_modules/.bin/po2json -f mf src/assets/i18n/cs.po src/assets/i18n/cs.json && ./node_modules/.bin/po2json -f mf src/assets/i18n/ru.po src/assets/i18n/ru.json",
"po2json-tempfix": "./node_modules/.bin/po2json -f mf src/assets/i18n/de.po /dev/stdout | sed -f sed_replacements > src/assets/i18n/de.json && ./node_modules/.bin/po2json -f mf src/assets/i18n/cs.po /dev/stdout | sed -f sed_replacements > src/assets/i18n/cs.json && ./node_modules/.bin/po2json -f mf src/assets/i18n/ru.po /dev/stdout | sed -f sed_replacements > src/assets/i18n/ru.json",
"prettify-check": "prettier --config ./.prettierrc --list-different \"src/{app,environments}/**/*{.ts,.js,.json,.css,.scss}\"",
@ -80,6 +80,7 @@
"@angular/compiler-cli": "~9.1.0",
"@angular/language-service": "~9.1.0",
"@biesbjerg/ngx-translate-extract": "^6.0.3",
"@biesbjerg/ngx-translate-extract-marker": "^1.0.0",
"@compodoc/compodoc": "^1.1.8",
"@schematics/angular": "^9.0.6",
"@types/jasmine": "^3.3.9",

View File

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { _ } from 'app/core/translate/translation-marker';
import { BannerDefinition, BannerService } from '../ui-services/banner.service';
/**

View File

@ -1,4 +1,4 @@
import { _ } from 'app/core/translate/translation-marker';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
/**
* Add strings here that require translations but have never been declared

View File

@ -1,12 +0,0 @@
/**
* Mark strings as translateable for ng-translate-extract.
* Marked strings are added into template-en.pot by 'npm run extract'.
*
* @example
* ```ts
* _('translateable string');
* ```
*/
export function _(str: string): string {
return str;
}

View File

@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { _ } from 'app/core/translate/translation-marker';
import { ViewAssignmentPoll } from 'app/site/assignments/models/view-assignment-poll';
import { ViewMotionPoll } from 'app/site/motions/models/view-motion-poll';
import { ViewBasePoll } from 'app/site/polls/models/view-base-poll';

View File

@ -1,4 +1,5 @@
import { _ } from 'app/core/translate/translation-marker';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { BaseModel } from '../base/base-model';
/**

View File

@ -4,6 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { Title } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { PblColumnDefinition } from '@pebula/ngrid';
@ -16,7 +17,6 @@ import { PdfDocumentService } from 'app/core/pdf-services/pdf-document.service';
import { ItemRepositoryService } from 'app/core/repositories/agenda/item-repository.service';
import { ListOfSpeakersRepositoryService } from 'app/core/repositories/agenda/list-of-speakers-repository.service';
import { TopicRepositoryService } from 'app/core/repositories/topics/topic-repository.service';
import { _ } from 'app/core/translate/translation-marker';
import { ConfigService } from 'app/core/ui-services/config.service';
import { DurationService } from 'app/core/ui-services/duration.service';
import { PromptService } from 'app/core/ui-services/prompt.service';

View File

@ -1,6 +1,6 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { BehaviorSubject } from 'rxjs';
import { _ } from 'app/core/translate/translation-marker';
import { ChartData } from 'app/shared/components/charts/charts.component';
import {
AssignmentPoll,

View File

@ -1,4 +1,5 @@
import { _ } from 'app/core/translate/translation-marker';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { ConfigService } from 'app/core/ui-services/config.service';
import { DiffLinesInParagraph } from 'app/core/ui-services/diff.service';
import { SearchProperty, SearchRepresentation } from 'app/core/ui-services/search.service';

View File

@ -1,11 +1,11 @@
import { Injectable } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { OpenSlidesStatusService } from 'app/core/core-services/openslides-status.service';
import { StorageService } from 'app/core/core-services/storage.service';
import { Deferred } from 'app/core/promises/deferred';
import { _ } from 'app/core/translate/translation-marker';
import { BaseSortListService } from 'app/core/ui-services/base-sort-list.service';
import { OsSortingDefinition, OsSortingOption } from 'app/core/ui-services/base-sort.service';
import { ConfigService } from 'app/core/ui-services/config.service';

View File

@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { _ } from 'app/core/translate/translation-marker';
import { ChartData, ChartDate } from 'app/shared/components/charts/charts.component';
import { AssignmentPollMethod } from 'app/shared/models/assignments/assignment-poll';
import {

View File

@ -1,4 +1,5 @@
import { _ } from 'app/core/translate/translation-marker';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { Countdown } from 'app/shared/models/core/countdown';
import { BaseProjectableViewModel } from 'app/site/base/base-projectable-view-model';
import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable';

View File

@ -4,6 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { PblColumnDefinition } from '@pebula/ngrid';
@ -11,7 +12,6 @@ import { OperatorService } from 'app/core/core-services/operator.service';
import { StorageService } from 'app/core/core-services/storage.service';
import { GroupRepositoryService } from 'app/core/repositories/users/group-repository.service';
import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service';
import { _ } from 'app/core/translate/translation-marker';
import { ChoiceService } from 'app/core/ui-services/choice.service';
import { ConfigService } from 'app/core/ui-services/config.service';
import { CsvExportService } from 'app/core/ui-services/csv-export.service';