Localized static text
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:resume/widgets/language_dropdown.dart';
|
|||||||
import 'package:resume/widgets/profile.dart';
|
import 'package:resume/widgets/profile.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:resume/constants.dart' show ContentType;
|
import 'package:resume/constants.dart' show ContentType;
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import '../services/content_provider.dart';
|
import '../services/content_provider.dart';
|
||||||
import '../widgets/content_block.dart';
|
import '../widgets/content_block.dart';
|
||||||
@@ -43,15 +44,15 @@ class _LandingPageState extends State<LandingPage> {
|
|||||||
(MediaQuery.of(context).size.width - _getMainContentWidth()) / 2;
|
(MediaQuery.of(context).size.width - _getMainContentWidth()) / 2;
|
||||||
|
|
||||||
Widget _getSideBar() {
|
Widget _getSideBar() {
|
||||||
return const Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
ContentBlock(
|
ContentBlock(
|
||||||
blockTitle: 'Fähigkeiten',
|
blockTitle: AppLocalizations.of(context)!.skills,
|
||||||
contentType: ContentType.skills,
|
contentType: ContentType.skills,
|
||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(bottom: 25)),
|
const Padding(padding: EdgeInsets.only(bottom: 25)),
|
||||||
ContentBlock(
|
ContentBlock(
|
||||||
blockTitle: 'Sprachen',
|
blockTitle: AppLocalizations.of(context)!.languages,
|
||||||
contentType: ContentType.language,
|
contentType: ContentType.language,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -59,25 +60,25 @@ class _LandingPageState extends State<LandingPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _getMainContent() {
|
Widget _getMainContent() {
|
||||||
return const Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
ContentBlock(
|
ContentBlock(
|
||||||
blockTitle: 'Arbeitserfahrung',
|
blockTitle: AppLocalizations.of(context)!.work_experience,
|
||||||
contentType: ContentType.experience,
|
contentType: ContentType.experience,
|
||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(bottom: 25)),
|
const Padding(padding: EdgeInsets.only(bottom: 25)),
|
||||||
ContentBlock(
|
ContentBlock(
|
||||||
blockTitle: 'Bildungsweg',
|
blockTitle: AppLocalizations.of(context)!.education,
|
||||||
contentType: ContentType.education,
|
contentType: ContentType.education,
|
||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(bottom: 25)),
|
const Padding(padding: EdgeInsets.only(bottom: 25)),
|
||||||
ContentBlock(
|
ContentBlock(
|
||||||
blockTitle: 'Weitere Kenntnisse',
|
blockTitle: AppLocalizations.of(context)!.additional_skills,
|
||||||
contentType: ContentType.generalSkills,
|
contentType: ContentType.generalSkills,
|
||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(bottom: 25)),
|
const Padding(padding: EdgeInsets.only(bottom: 25)),
|
||||||
ContentBlock(
|
ContentBlock(
|
||||||
blockTitle: "Über mich",
|
blockTitle: AppLocalizations.of(context)!.about_me,
|
||||||
contentType: ContentType.text,
|
contentType: ContentType.text,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -189,10 +190,12 @@ class _LandingPageState extends State<LandingPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Lebenslauf'),
|
title: Text(AppLocalizations.of(context)!.resume),
|
||||||
actions: const [
|
actions: [
|
||||||
TextButton(onPressed: _launchURL, child: Text('Source Code')),
|
TextButton(
|
||||||
LanguageDropdown(),
|
onPressed: _launchURL,
|
||||||
|
child: Text(AppLocalizations.of(context)!.source_code)),
|
||||||
|
const LanguageDropdown(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: !loadingDone
|
body: !loadingDone
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
class LanguageDropdown extends StatelessWidget {
|
class LanguageDropdown extends StatelessWidget {
|
||||||
const LanguageDropdown({super.key});
|
const LanguageDropdown({super.key});
|
||||||
@@ -10,11 +11,17 @@ class LanguageDropdown extends StatelessWidget {
|
|||||||
items: [
|
items: [
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
value: 'de',
|
value: 'de',
|
||||||
child: getMenuItem('Deutsch', 'assets/de_icon.png'),
|
child: getMenuItem(
|
||||||
|
AppLocalizations.of(context)!.german,
|
||||||
|
'assets/de_icon.png',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
value: 'en',
|
value: 'en',
|
||||||
child: getMenuItem('Englisch', 'assets/gb_icon.png'),
|
child: getMenuItem(
|
||||||
|
AppLocalizations.of(context)!.english,
|
||||||
|
'assets/gb_icon.png',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onChanged: _onChanged,
|
onChanged: _onChanged,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
class LanguageWidget extends StatelessWidget {
|
class LanguageWidget extends StatelessWidget {
|
||||||
const LanguageWidget({super.key});
|
const LanguageWidget({super.key});
|
||||||
@@ -18,8 +19,9 @@ class LanguageWidget extends StatelessWidget {
|
|||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Deutsch', style: Theme.of(context).textTheme.bodyLarge),
|
Text(AppLocalizations.of(context)!.german,
|
||||||
Text('Muttersprache',
|
style: Theme.of(context).textTheme.bodyLarge),
|
||||||
|
Text(AppLocalizations.of(context)!.mother_tongue,
|
||||||
style: Theme.of(context).textTheme.bodyMedium),
|
style: Theme.of(context).textTheme.bodyMedium),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -36,8 +38,10 @@ class LanguageWidget extends StatelessWidget {
|
|||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Englisch', style: Theme.of(context).textTheme.bodyLarge),
|
Text(AppLocalizations.of(context)!.english,
|
||||||
Text('Sehr gut', style: Theme.of(context).textTheme.bodyMedium),
|
style: Theme.of(context).textTheme.bodyLarge),
|
||||||
|
Text(AppLocalizations.of(context)!.very_good,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user