Added german translations for label plugin

This commit is contained in:
Jan Böhmer 2022-07-29 20:52:26 +02:00
parent eba89cee62
commit 5918c55855
3 changed files with 101 additions and 105 deletions

View file

@ -1,6 +1,6 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
require('./lang/en.js'); require('./lang/de.js');
import { addListToDropdown, createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; import { addListToDropdown, createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils';
@ -23,7 +23,7 @@ export default class PartDBLabelUI extends Plugin {
dropdownView.buttonView.set( { dropdownView.buttonView.set( {
// The t() function helps localize the editor. All strings enclosed in t() can be // The t() function helps localize the editor. All strings enclosed in t() can be
// translated and change when the language of the editor changes. // translated and change when the language of the editor changes.
label: t( 'part_db.label' ), label: t( 'Label Placeholder' ),
tooltip: true, tooltip: true,
withText: true withText: true
} ); } );
@ -45,64 +45,64 @@ export default class PartDBLabelUI extends Plugin {
const PLACEHOLDERS = [ const PLACEHOLDERS = [
{ {
label: 'section.part', label: 'Part',
entries: [ entries: [
['[[ID]]', 'part.id'], ['[[ID]]', 'Database ID'],
['[[NAME]]', 'part.name'], ['[[NAME]]', 'Part name'],
['[[CATEGORY]]', 'part.category'], ['[[CATEGORY]]', 'Category'],
['[[CATEGORY_FULL]]', 'part.category_full'], ['[[CATEGORY_FULL]]', 'Category (Full path)'],
['[[MANUFACTURER]]', 'part.manufacturer'], ['[[MANUFACTURER]]', 'Manufacturer'],
['[[MANUFACTURER_FULL]]', 'part.manufacturer_full'], ['[[MANUFACTURER_FULL]]', 'Manufacturer (Full path)'],
['[[FOOTPRINT]]', 'part.footprint'], ['[[FOOTPRINT]]', 'Footprint'],
['[[FOOTPRINT_FULL]]', 'part.footprint'], ['[[FOOTPRINT_FULL]]', 'Footprint (Full path)'],
['[[MASS]]', 'part.mass'], ['[[MASS]]', 'Mass'],
['[[MPN]]', 'part.mpn'], ['[[MPN]]', 'Manufacturer Product Number (MPN)'],
['[[TAGS]]', 'part.tags'], ['[[TAGS]]', 'Tags'],
['[[M_STATUS]]', 'part.status'], ['[[M_STATUS]]', 'Manufacturing status'],
['[[DESCRIPTION]]', 'part.description'], ['[[DESCRIPTION]]', 'Description'],
['[[DESCRIPTION_T]]', 'part.description_t'], ['[[DESCRIPTION_T]]', 'Description (plain text)'],
['[[COMMENT]]', 'part.comment'], ['[[COMMENT]]', 'Comment'],
['[[COMMENT_T]]', 'part.comment_t'], ['[[COMMENT_T]]', 'Comment (plain text)'],
['[[LAST_MODIFIED]]', 'part.last_modified'], ['[[LAST_MODIFIED]]', 'Last modified datetime'],
['[[CREATION_DATE]]', 'part.creation_date'], ['[[CREATION_DATE]]', 'Creation datetime'],
] ]
}, },
{ {
label: 'section.part_lot', label: 'Part lot',
entries: [ entries: [
['[[LOT_ID]]', 'lot.id'], ['[[LOT_ID]]', 'Lot ID'],
['[[LOT_NAME]]', 'lot.name'], ['[[LOT_NAME]]', 'Lot name'],
['[[LOT_COMMENT]]', 'lot.comment'], ['[[LOT_COMMENT]]', 'Lot comment'],
['[[EXPIRATION_DATE]]', 'lot.expiration_date'], ['[[EXPIRATION_DATE]]', 'Lot expiration date'],
['[[AMOUNT]]', 'lot.amount'], ['[[AMOUNT]]', 'Lot amount'],
['[[LOCATION]]', 'lot.location'], ['[[LOCATION]]', 'Storage location'],
['[[LOCATION_FULL]]', 'lot.location_full'], ['[[LOCATION_FULL]]', 'Storage location (Full path)'],
] ]
}, },
{ {
label: 'section.storelocation', label: 'Storage location',
entries: [ entries: [
['[[ID]]', 'storelocation.id'], ['[[ID]]', 'Location ID'],
['[[NAME]]', 'storelocation.name'], ['[[NAME]]', 'Name'],
['[[FULL_PATH]]', 'storelocation.full_path'], ['[[FULL_PATH]]', 'Full path'],
['[[PARENT]]', 'storelocation.parent_name'], ['[[PARENT]]', 'Parent name'],
['[[PARENT_FULL_PATH]]', 'storelocation.parent_full_path'], ['[[PARENT_FULL_PATH]]', 'Parent full path'],
['[[COMMENT]]', 'storelocation.comment'], ['[[COMMENT]]', 'Comment'],
['[[COMMENT_T]]', 'storelocation.comment_t'], ['[[COMMENT_T]]', 'Comment (plain text)'],
['[[LAST_MODIFIED]]', 'storelocation.last_modified'], ['[[LAST_MODIFIED]]', 'Last modified datetime'],
['[[CREATION_DATE]]', 'storelocation.creation_date'], ['[[CREATION_DATE]]', 'Creation datetime'],
] ]
}, },
{ {
label: 'section.global', label: 'Globals',
entries: [ entries: [
['[[USERNAME]]', 'global.username'], ['[[USERNAME]]', 'Username'],
['[[USERNAME_FULL]]', 'global.username_full'], ['[[USERNAME_FULL]]', 'Username (including name)'],
['[[DATETIME]]', 'global.datetime'], ['[[DATETIME]]', 'Current datetime'],
['[[DATE]]', 'global.date'], ['[[DATE]]', 'Current date'],
['[[TIME]]', 'global.time'], ['[[TIME]]', 'Current time'],
['[[INSTALL_NAME]]', 'global.install_name'], ['[[INSTALL_NAME]]', 'Instance name'],
['[[TYPE]]', 'global.type'] ['[[TYPE]]', 'Target type']
], ],
}, },
]; ];

View file

@ -0,0 +1,54 @@
// Make sure that the global object is defined. If not, define it.
window.CKEDITOR_TRANSLATIONS = window.CKEDITOR_TRANSLATIONS || {};
// Make sure that the dictionary for Polish translations exist.
window.CKEDITOR_TRANSLATIONS[ 'de' ] = window.CKEDITOR_TRANSLATIONS[ 'de' ] || {};
window.CKEDITOR_TRANSLATIONS[ 'de' ].dictionary = window.CKEDITOR_TRANSLATIONS[ 'de' ].dictionary || {};
// Extend the dictionary for Polish translations with your translations:
Object.assign( window.CKEDITOR_TRANSLATIONS[ 'de' ].dictionary, {
'Label Placeholder': 'Label Platzhalter',
'Part': 'Bauteil',
'Database ID': 'Datenbank ID',
'Part name': 'Bauteilname',
'Category': 'Kategorie',
'Category (Full path)': 'Kategorie (Vollständiger Pfad)',
'Manufacturer': 'Hersteller',
'Manufacturer (Full path)': 'Hersteller (Vollständiger Pfad)',
'Footprint': 'Footprint',
'Footprint (Full path)': 'Footprint (Vollständiger Pfad)',
'Mass': 'Gewicht',
'Manufacturer Product Number (MPN)': 'Hersteller Produktnummer (MPN)',
'Tags': 'Tags',
'Manufacturing status': 'Herstellungsstatus',
'Description': 'Beschreibung',
'Description (plain text)': 'Beschreibung (Nur-Text)',
'Comment': 'Kommentar',
'Comment (plain text)': 'Kommentar (Nur-Text)',
'Last modified datetime': 'Zuletzt geändert',
'Creation datetime': 'Erstellt',
'Lot ID': 'Lot ID',
'Lot name': 'Lot Name',
'Lot comment': 'Lot Kommentar',
'Lot expiration date': 'Lot Ablaufdatum',
'Lot amount': 'Lot Menge',
'Storage location': 'Lagerort',
'Storage location (Full path)': 'Lagerort (Vollständiger Pfad)',
'Location ID': 'Lagerort ID',
'Name': 'Name',
'Full path': 'Vollständiger Pfad',
'Parent name': 'Name des Übergeordneten Elements',
'Parent full path': 'Ganzer Pfad des Übergeordneten Elements',
'Username': 'Benutzername',
'Username (including name)': 'Benutzername (inklusive Name)',
'Current datetime': 'Aktuelle Datum/Zeit',
'Current date': 'Aktuelles Datum',
'Current time': 'Aktuelle Zeit',
'Instance name': 'Instanzname',
'Target type': 'Zieltyp',
} );

View file

@ -1,58 +0,0 @@
// Make sure that the global object is defined. If not, define it.
window.CKEDITOR_TRANSLATIONS = window.CKEDITOR_TRANSLATIONS || {};
// Make sure that the dictionary for Polish translations exist.
window.CKEDITOR_TRANSLATIONS[ 'en' ] = window.CKEDITOR_TRANSLATIONS[ 'en' ] || {};
window.CKEDITOR_TRANSLATIONS[ 'en' ].dictionary = window.CKEDITOR_TRANSLATIONS[ 'en' ].dictionary || {};
// Extend the dictionary for Polish translations with your translations:
Object.assign( window.CKEDITOR_TRANSLATIONS[ 'en' ].dictionary, {
'part_db.title': 'Insert Placeholders',
'part_db.label': 'Placeholders',
'section.global': 'Globals',
'section.part': 'Part',
'section.part_lot': 'Part lot',
'section.storelocation': 'Storage location',
'part.id': 'Database ID',
'part.name': 'Part name',
'part.category': 'Category',
'part.category_full': 'Category (Full path)',
'part.manufacturer': 'Manufacturer',
'part.manufacturer_full': 'Manufacturer (Full path)',
'part.footprint': 'Footprint',
'part.footprint_full': 'Footprint (Full path)',
'part.mass': 'Mass',
'part.tags': 'Tags',
'part.mpn': 'Manufacturer Product Number (MPN)',
'part.status': 'Manufacturing status',
'part.description': 'Description',
'part.description_t': 'Description (Text)',
'part.comment': 'Comment',
'part.comment_t': 'Comment (Text)',
'part.last_modified': 'Last modified datetime',
'part.creation_date': 'Creation datetime',
'global.username': 'Username',
'global.username_full': 'Username (including name)',
'global.datetime': 'Current datetime',
'global.date': 'Current date',
'global.time': 'Current time',
'global.install_name': 'Instance name',
'global.type': 'Target type',
'lot.id': 'Lot ID',
'lot.name': 'Lot name',
'lot.comment': 'Lot comment',
'lot.expiration_date': 'Expiration date',
'lot.amount': 'Lot amount',
'lot.location': 'Storage location',
'lot.location_full': 'Storage location (Full path)',
'storelocation.id': 'Location ID',
'storelocation.name': 'Name',
'storelocation.full_path': 'Full path',
'storelocation.parent_name': 'Parent name',
'storelocation.parent_full_path': 'Parent full path',
'storelocation.comment': 'Comment',
'storelocation.comment_t': 'Comment (Text)',
'storelocation.last_modified': 'Last modified datetime',
'storelocation.creation_date': 'Createion datetime',
} );