Improved i18n
This commit is contained in:
parent
c9737423a9
commit
fb22a0b2d1
|
|
@ -47,8 +47,8 @@ msgstr "Downloader"
|
||||||
msgid "Downloading (no progress available)..."
|
msgid "Downloading (no progress available)..."
|
||||||
msgstr "Lädt herunter (Kein Fortschritt verfügbar) …"
|
msgstr "Lädt herunter (Kein Fortschritt verfügbar) …"
|
||||||
|
|
||||||
msgid "Downloading..."
|
msgid "Downloading... {0}"
|
||||||
msgstr "Herunterladen …"
|
msgstr "Herunterladen … {0}"
|
||||||
|
|
||||||
msgid "Manage existing machines"
|
msgid "Manage existing machines"
|
||||||
msgstr "Bestehende Maschinen verwalten"
|
msgstr "Bestehende Maschinen verwalten"
|
||||||
|
|
@ -56,11 +56,11 @@ msgstr "Bestehende Maschinen verwalten"
|
||||||
msgid "Manager"
|
msgid "Manager"
|
||||||
msgstr "Manager"
|
msgstr "Manager"
|
||||||
|
|
||||||
msgid "Mbs downloaded"
|
msgid "{0} Mbs downloaded"
|
||||||
msgstr "MB heruntergeladen"
|
msgstr "{0} MB heruntergeladen"
|
||||||
|
|
||||||
msgid "Now run"
|
msgid "Now run {0} to start the VM"
|
||||||
msgstr ""
|
msgstr "Now run {0} um die VM zu starten"
|
||||||
|
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
msgstr "OK"
|
msgstr "OK"
|
||||||
|
|
@ -81,7 +81,7 @@ msgid "Select option"
|
||||||
msgstr "Option auswählen"
|
msgstr "Option auswählen"
|
||||||
|
|
||||||
msgid "Select version for"
|
msgid "Select version for"
|
||||||
msgstr "Version auswählen für"
|
msgstr "Version auswählen für {0}"
|
||||||
|
|
||||||
msgid "Select..."
|
msgid "Select..."
|
||||||
msgstr "Auswählen …"
|
msgstr "Auswählen …"
|
||||||
|
|
@ -95,11 +95,8 @@ msgstr "SSH-Port"
|
||||||
msgid "Stop The Virtual Machine?"
|
msgid "Stop The Virtual Machine?"
|
||||||
msgstr "Die virtuelle Maschine stoppen?"
|
msgstr "Die virtuelle Maschine stoppen?"
|
||||||
|
|
||||||
msgid "Target folder"
|
msgid "Target folder : {0}"
|
||||||
msgstr "Zielverzeichnis"
|
msgstr "Zielverzeichnis : {0}"
|
||||||
|
|
||||||
msgid "to start the VM"
|
|
||||||
msgstr "um die VM zu starten"
|
|
||||||
|
|
||||||
msgid "Use SPICE display"
|
msgid "Use SPICE display"
|
||||||
msgstr "SPICE-Display verwenden"
|
msgstr "SPICE-Display verwenden"
|
||||||
|
|
@ -113,5 +110,5 @@ msgstr "Version"
|
||||||
msgid "Waiting for download to start"
|
msgid "Waiting for download to start"
|
||||||
msgstr "Warten auf den Beginn des Downloads"
|
msgstr "Warten auf den Beginn des Downloads"
|
||||||
|
|
||||||
msgid "You are about to terminate the virtual machine"
|
msgid "You are about to terminate the virtual machine {0}"
|
||||||
msgstr "Sie sind dabei, die virtuelle Maschine zu beenden"
|
msgstr "Sie sind dabei, die virtuelle Maschine zu beenden {0}"
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ msgid "Downloading (no progress available)..."
|
||||||
msgstr "Downloading (no progress available)..."
|
msgstr "Downloading (no progress available)..."
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Downloading..."
|
msgid "Downloading... {0}"
|
||||||
msgstr "Downloading..."
|
msgstr "Downloading... {0}"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Manage existing machines"
|
msgid "Manage existing machines"
|
||||||
|
|
@ -70,12 +70,12 @@ msgid "Manager"
|
||||||
msgstr "Manager"
|
msgstr "Manager"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Mbs downloaded"
|
msgid "{0} Mbs downloaded"
|
||||||
msgstr "Mbs downloaded"
|
msgstr "{0} Mbs downloaded"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Now run"
|
msgid "Now run {0} to start the VM"
|
||||||
msgstr "Now run"
|
msgstr "Now run {0} to start the VM"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
|
|
@ -102,8 +102,8 @@ msgid "Select option"
|
||||||
msgstr "Select option"
|
msgstr "Select option"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Select version for"
|
msgid "Select version for {0}"
|
||||||
msgstr "Select version for"
|
msgstr "Select version for {0}"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Select..."
|
msgid "Select..."
|
||||||
|
|
@ -122,12 +122,8 @@ msgid "Stop The Virtual Machine?"
|
||||||
msgstr "Stop The Virtual Machine?"
|
msgstr "Stop The Virtual Machine?"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Target folder"
|
msgid "Target folder : {0}"
|
||||||
msgstr "Target folder"
|
msgstr "Target folder : {0}"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "to start the VM"
|
|
||||||
msgstr "to start the VM"
|
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Use SPICE display"
|
msgid "Use SPICE display"
|
||||||
|
|
@ -146,5 +142,5 @@ msgid "Waiting for download to start"
|
||||||
msgstr "Waiting for download to start"
|
msgstr "Waiting for download to start"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "You are about to terminate the virtual machine"
|
msgid "You are about to terminate the virtual machine {0}"
|
||||||
msgstr "You are about to terminate the virtual machine"
|
msgstr "You are about to terminate the virtual machine {0}"
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ msgid "Downloading (no progress available)..."
|
||||||
msgstr "Téléchargement (pas de barre de progression)..."
|
msgstr "Téléchargement (pas de barre de progression)..."
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Downloading..."
|
msgid "Downloading... {0}"
|
||||||
msgstr "Téléchargement..."
|
msgstr "Téléchargement... {0}"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Manage existing machines"
|
msgid "Manage existing machines"
|
||||||
|
|
@ -70,12 +70,12 @@ msgid "Manager"
|
||||||
msgstr "Gestionnaire"
|
msgstr "Gestionnaire"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Mbs downloaded"
|
msgid "{0} Mbs downloaded"
|
||||||
msgstr "Mbs téléchargés"
|
msgstr "{0} Mbs téléchargés"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Now run"
|
msgid "Now run {0} to start the VM"
|
||||||
msgstr "Lancer"
|
msgstr "Lancer {0} pour démarrer la machine virtuelle"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
|
|
@ -102,8 +102,8 @@ msgid "Select option"
|
||||||
msgstr "Sélectionner une option"
|
msgstr "Sélectionner une option"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Select version for"
|
msgid "Select version for {0}"
|
||||||
msgstr "Sélectionner une version pour"
|
msgstr "Sélectionner une version pour {0}"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Select..."
|
msgid "Select..."
|
||||||
|
|
@ -122,12 +122,8 @@ msgid "Stop The Virtual Machine?"
|
||||||
msgstr "Arrêtez la machine virtuelle ?"
|
msgstr "Arrêtez la machine virtuelle ?"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Target folder"
|
msgid "Target folder : {0}"
|
||||||
msgstr "Dossier cible"
|
msgstr "Dossier cible : {0}"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "to start the VM"
|
|
||||||
msgstr "pour démarrer la machine virtuelle"
|
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Use SPICE display"
|
msgid "Use SPICE display"
|
||||||
|
|
@ -146,5 +142,5 @@ msgid "Waiting for download to start"
|
||||||
msgstr "En attente du début du téléchargement"
|
msgstr "En attente du début du téléchargement"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "You are about to terminate the virtual machine"
|
msgid "You are about to terminate the virtual machine {0}"
|
||||||
msgstr "Vous êtes sur le point d'arrêter la machine virtuelle"
|
msgstr "Vous êtes sur le point d'arrêter la machine virtuelle {0}"
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ msgstr ""
|
||||||
msgid "Downloading (no progress available)..."
|
msgid "Downloading (no progress available)..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Downloading..."
|
msgid "Downloading... {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Manage existing machines"
|
msgid "Manage existing machines"
|
||||||
|
|
@ -55,10 +55,10 @@ msgstr ""
|
||||||
msgid "Manager"
|
msgid "Manager"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Mbs downloaded"
|
msgid "{0} Mbs downloaded"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Now run"
|
msgid "Now run {0} to start the VM"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
|
|
@ -79,7 +79,7 @@ msgstr ""
|
||||||
msgid "Select option"
|
msgid "Select option"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Select version for"
|
msgid "Select version for {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Select..."
|
msgid "Select..."
|
||||||
|
|
@ -94,10 +94,7 @@ msgstr ""
|
||||||
msgid "Stop The Virtual Machine?"
|
msgid "Stop The Virtual Machine?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Target folder"
|
msgid "Target folder : {0}"
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "to start the VM"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Use SPICE display"
|
msgid "Use SPICE display"
|
||||||
|
|
@ -112,5 +109,5 @@ msgstr ""
|
||||||
msgid "Waiting for download to start"
|
msgid "Waiting for download to start"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "You are about to terminate the virtual machine"
|
msgid "You are about to terminate the virtual machine {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@ import 'package:flutter/material.dart';
|
||||||
import 'quickgui_localizations.dart';
|
import 'quickgui_localizations.dart';
|
||||||
|
|
||||||
extension I18nExt on BuildContext {
|
extension I18nExt on BuildContext {
|
||||||
t(String key) => QuickguiLocalizations.of(this).t(key);
|
t(String key, {List<Object>? args}) => QuickguiLocalizations.of(this).t(key, args);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gettext/gettext.dart';
|
import 'package:gettext/gettext.dart';
|
||||||
import 'package:gettext_parser/gettext_parser.dart' as gettext_parser;
|
import 'package:gettext_parser/gettext_parser.dart' as gettext_parser;
|
||||||
|
import 'package:quiver/iterables.dart';
|
||||||
|
|
||||||
class QuickguiLocalizations {
|
class QuickguiLocalizations {
|
||||||
final _gt = Gettext(
|
final _gt = Gettext(
|
||||||
|
|
@ -24,5 +25,15 @@ class QuickguiLocalizations {
|
||||||
|
|
||||||
static QuickguiLocalizations of(BuildContext context) => Localizations.of<QuickguiLocalizations>(context, QuickguiLocalizations)!;
|
static QuickguiLocalizations of(BuildContext context) => Localizations.of<QuickguiLocalizations>(context, QuickguiLocalizations)!;
|
||||||
|
|
||||||
String t(String key) => _gt.gettext(key);
|
String t(String key, List<Object>? args) {
|
||||||
|
var message = _gt.gettext(key);
|
||||||
|
|
||||||
|
if (args != null) {
|
||||||
|
for (var i in range(args.length)) {
|
||||||
|
message = message.replaceAll('{$i}', args[i.toInt()].toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ class _DownloaderState extends State<Downloader> {
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 32),
|
padding: const EdgeInsets.only(top: 32),
|
||||||
child: Text('${context.t('Target folder')} : ${Directory.current}'),
|
child: Text(context.t('Target folder : {0}', args: [Directory.current])),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,9 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
color: active ? Colors.green : buttonColor,
|
color: active ? Colors.green : buttonColor,
|
||||||
semanticLabel: active ? 'Running' : 'Run',
|
semanticLabel: active ? 'Running' : 'Run',
|
||||||
),
|
),
|
||||||
onPressed: active ? null : () async {
|
onPressed: active
|
||||||
|
? null
|
||||||
|
: () async {
|
||||||
Map<String, VmInfo> activeVms = _activeVms;
|
Map<String, VmInfo> activeVms = _activeVms;
|
||||||
List<String> args = ['--vm', currentVm + '.conf'];
|
List<String> args = ['--vm', currentVm + '.conf'];
|
||||||
if (_spicy) {
|
if (_spicy) {
|
||||||
|
|
@ -245,12 +247,14 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
color: active ? Colors.red : null,
|
color: active ? Colors.red : null,
|
||||||
semanticLabel: active ? 'Stop' : 'Not running',
|
semanticLabel: active ? 'Stop' : 'Not running',
|
||||||
),
|
),
|
||||||
onPressed: !active ? null : () {
|
onPressed: !active
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
showDialog<bool>(
|
showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
title: Text(context.t('Stop The Virtual Machine?')),
|
title: Text(context.t('Stop The Virtual Machine?')),
|
||||||
content: Text('${context.t('You are about to terminate the virtual machine')} $currentVm'),
|
content: Text(context.t('You are about to terminate the virtual machine', args: [currentVm])),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context, false),
|
onPressed: () => Navigator.pop(context, false),
|
||||||
|
|
@ -277,13 +281,8 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
)),
|
)),
|
||||||
if (connectInfo.isNotEmpty)
|
if (connectInfo.isNotEmpty)
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(connectInfo, style: const TextStyle(fontSize: 12)),
|
||||||
connectInfo,
|
trailing: Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
|
||||||
style: TextStyle(fontSize: 12)
|
|
||||||
),
|
|
||||||
trailing: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.monitor,
|
Icons.monitor,
|
||||||
|
|
@ -291,18 +290,18 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
semanticLabel: 'Connect display with SPICE',
|
semanticLabel: 'Connect display with SPICE',
|
||||||
),
|
),
|
||||||
tooltip: _spicy ? 'Connect display with SPICE' : 'SPICE client not found',
|
tooltip: _spicy ? 'Connect display with SPICE' : 'SPICE client not found',
|
||||||
onPressed: !_spicy? null : () {
|
onPressed: !_spicy
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
Process.start('spicy', ['-p', vmInfo.spicePort!]);
|
Process.start('spicy', ['-p', vmInfo.spicePort!]);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset('assets/images/console.svg', semanticsLabel: 'Connect with SSH', color: sshy ? buttonColor : Colors.grey),
|
||||||
'assets/images/console.svg',
|
|
||||||
semanticsLabel: 'Connect with SSH',
|
|
||||||
color: sshy ? buttonColor : Colors.grey
|
|
||||||
),
|
|
||||||
tooltip: sshy ? 'Connect with SSH' : 'SSH server not detected on guest',
|
tooltip: sshy ? 'Connect with SSH' : 'SSH server not detected on guest',
|
||||||
onPressed: !sshy ? null : () {
|
onPressed: !sshy
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
TextEditingController _usernameController = TextEditingController();
|
TextEditingController _usernameController = TextEditingController();
|
||||||
showDialog<bool>(
|
showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -350,9 +349,7 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]
|
])),
|
||||||
)
|
|
||||||
),
|
|
||||||
const Divider()
|
const Divider()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class _VersionSelectionState extends State<VersionSelection> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('${context.t('Select version for')} ${widget.operatingSystem.name}'),
|
title: Text(context.t('Select version for {0}', args: [widget.operatingSystem.name])),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ class DownloadLabel extends StatelessWidget {
|
||||||
: data != null
|
: data != null
|
||||||
? downloader != 'zsync'
|
? downloader != 'zsync'
|
||||||
? downloader == 'wget'
|
? downloader == 'wget'
|
||||||
? Text('${context.t('Downloading...')}${(data! * 100).toInt()}%')
|
? Text(context.t('Downloading...{0}%', args: [(data! * 100).toInt()]))
|
||||||
: Text('$data ${context.t('Mbs downloaded')}')
|
: Text(context.t('{0} Mbs downloaded', args: [data!]))
|
||||||
: Text(context.t("Downloading (no progress available)..."))
|
: Text(context.t("Downloading (no progress available)..."))
|
||||||
: Text(context.t('Waiting for download to start')),
|
: Text(context.t('Waiting for download to start')),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class _HomePageButtonGroupState extends State<HomePageButtonGroup> {
|
||||||
padding: const EdgeInsets.symmetric(vertical: 32),
|
padding: const EdgeInsets.symmetric(vertical: 32),
|
||||||
child: Text(context.t('Done !'), style: Theme.of(context).textTheme.bodyText1?.copyWith(color: Colors.white)),
|
child: Text(context.t('Done !'), style: Theme.of(context).textTheme.bodyText1?.copyWith(color: Colors.white)),
|
||||||
),
|
),
|
||||||
Text('${context.t('Now run')} "quickemu --vm $operatingSystem-$version" ${context.t('to start the VM')}',
|
Text(context.t('Now run {0} to start the VM', args: ["quickemu --vm $operatingSystem-$version"]),
|
||||||
style: Theme.of(context).textTheme.bodyText1?.copyWith(color: Colors.white)),
|
style: Theme.of(context).textTheme.bodyText1?.copyWith(color: Colors.white)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 32),
|
padding: const EdgeInsets.symmetric(vertical: 32),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue