Skip to content

Commit

Permalink
Merge pull request #266 from enrique-lozano/feat/link-i18n-guide
Browse files Browse the repository at this point in the history
Add link to a translation contributing guide
  • Loading branch information
enrique-lozano authored Dec 14, 2024
2 parents 48517bf + 2b7d815 commit e2ccbc7
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/app/onboarding/intro.page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:monekin/app/onboarding/onboarding.dart';
import 'package:monekin/app/settings/about_page.dart';
import 'package:monekin/core/presentation/app_colors.dart';
import 'package:monekin/core/presentation/responsive/breakpoint_container.dart';
import 'package:monekin/core/presentation/widgets/html_text.dart';
import 'package:monekin/core/routes/route_utils.dart';
Expand Down Expand Up @@ -83,7 +84,7 @@ class IntroPage extends StatelessWidget {
const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w200),
tags: {
'a': TextStyle(
color: Colors.blue.shade200,
color: AppColors.of(context).link,
fontSize: 12.5,
fontWeight: FontWeight.w200)
},
Expand Down
31 changes: 31 additions & 0 deletions lib/app/settings/widgets/language_selector.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:monekin/app/settings/widgets/supported_locales.dart';
import 'package:monekin/core/presentation/app_colors.dart';
import 'package:monekin/core/presentation/widgets/html_text.dart';
import 'package:monekin/core/presentation/widgets/modal_container.dart';
import 'package:monekin/i18n/translations.g.dart';

Expand Down Expand Up @@ -49,6 +51,35 @@ class LanguageSelector extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: double.infinity,
child: Card(
margin: const EdgeInsets.fromLTRB(16, 0, 16, 12),
elevation: 0,
color: Theme.of(context).colorScheme.surfaceBright,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 12,
),
child: Row(
children: [
const Icon(Icons.translate_rounded),
const SizedBox(width: 12),
Flexible(
child: HTMLText(
htmlString: t.settings.lang_help,
tags: {
'a': TextStyle(
color: AppColors.of(context).link,
)
},
),
),
],
),
),
)),
...appSupportedLocales
.map((e) => _langRadioTile(context, supportedLocale: e)),
const SizedBox(height: 12)
Expand Down
6 changes: 6 additions & 0 deletions lib/core/presentation/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const brandBlue = Color(0xFF0F3375);

class AppColors extends ThemeExtension<AppColors> {
const AppColors({
required this.link,
required this.danger,
required this.success,
required this.brand,
Expand All @@ -14,6 +15,7 @@ class AppColors extends ThemeExtension<AppColors> {
required this.shadowColorLight,
});

final Color link;
final Color danger;
final Color success;
final Color brand;
Expand All @@ -26,6 +28,7 @@ class AppColors extends ThemeExtension<AppColors> {
final isDark = colorScheme.brightness == Brightness.dark;

return AppColors(
link: Colors.blue.shade200,
danger: isDark ? Colors.redAccent : Colors.red,
success:
isDark ? Colors.lightGreen : const Color.fromARGB(255, 55, 161, 59),
Expand All @@ -47,6 +50,7 @@ class AppColors extends ThemeExtension<AppColors> {

@override
AppColors copyWith({
Color? link,
Color? danger,
Color? success,
Color? brand,
Expand All @@ -58,6 +62,7 @@ class AppColors extends ThemeExtension<AppColors> {
Color? modalBackground,
}) {
return AppColors(
link: link ?? this.link,
danger: danger ?? this.danger,
success: success ?? this.success,
light: light ?? this.light,
Expand All @@ -74,6 +79,7 @@ class AppColors extends ThemeExtension<AppColors> {
return this;
}
return AppColors(
link: Color.lerp(link, other.link, t) ?? link,
danger: Color.lerp(danger, other.danger, t) ?? danger,
success: Color.lerp(success, other.success, t) ?? success,
light: Color.lerp(light, other.light, t) ?? light,
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions lib/i18n/strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
"lang.section": "Language and texts",
"lang.title": "App language",
"lang.descr": "Language in which the texts will be displayed in the app",
"lang.help": "If you want to collaborate with the translations of this app, you can consult <a href='https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n'>our guide</a>",
"locale": "Region",
"locale.descr": "Set the format to use for dates, numbers...",
"locale.warn": "When changing region the app will update",
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@
"lang.section": "Idioma y textos",
"lang.title": "Idioma de la aplicación",
"lang.descr": "Idioma en el que se mostrarán los textos en la aplicación",
"lang.help": "Si quieres colaborar con las traducciones de esta app puedes consultar <a href='https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n'>nuestra guía</a> ",
"locale": "Región",
"locale.descr": "Establecer el formato a utilizar para fechas, números...",
"locale.warn": "Al cambiar la región, la aplicación se actualizará",
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@
"lang.section": "Мова та тексти",
"lang.title": "Мова додатку",
"lang.descr": "Мова, в якій будуть відображатися тексти в додатку",
"lang.help": "Якщо ви хочете співпрацювати з перекладами цієї програми, ви можете звернутися до <a href='https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n'>нашого посібник</ a>",
"locale": "Регіон",
"locale.descr": "Встановіть формат, який буде використовуватися для дат, чисел...",
"locale.warn": "Після зміни регіону додаток оновиться",
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
"lang.section": "語言和文本",
"lang.title": "應用程式語言",
"lang.descr": "應用程式中顯示文字的語言",
"lang.help": "如果您想與此應用程式的翻譯合作,您可以參考<a href='https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n'>我們的指南</a>",
"locale": "地區",
"locale.descr": "設定用於日期、數字的格式...",
"locale.warn": "更改區域時應用程式將更新",
Expand Down
12 changes: 10 additions & 2 deletions lib/i18n/translations.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 4
/// Strings: 2189 (547 per locale)
/// Strings: 2193 (548 per locale)
///
/// Built on 2024-10-20 at 10:51 UTC
/// Built on 2024-12-14 at 13:11 UTC
// coverage:ignore-file
// ignore_for_file: type=lint
Expand Down Expand Up @@ -555,6 +555,7 @@ class _TranslationsSettingsEn {
String get lang_section => 'Language and texts';
String get lang_title => 'App language';
String get lang_descr => 'Language in which the texts will be displayed in the app';
String get lang_help => 'If you want to collaborate with the translations of this app, you can consult <a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>our guide</a>';
String get locale => 'Region';
String get locale_descr => 'Set the format to use for dates, numbers...';
String get locale_warn => 'When changing region the app will update';
Expand Down Expand Up @@ -1854,6 +1855,7 @@ class _TranslationsSettingsEs implements _TranslationsSettingsEn {
@override String get lang_section => 'Idioma y textos';
@override String get lang_title => 'Idioma de la aplicación';
@override String get lang_descr => 'Idioma en el que se mostrarán los textos en la aplicación';
@override String get lang_help => 'Si quieres colaborar con las traducciones de esta app puedes consultar <a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>nuestra guía</a> ';
@override String get locale => 'Región';
@override String get locale_descr => 'Establecer el formato a utilizar para fechas, números...';
@override String get locale_warn => 'Al cambiar la región, la aplicación se actualizará';
Expand Down Expand Up @@ -3154,6 +3156,7 @@ class _TranslationsSettingsUk implements _TranslationsSettingsEn {
@override String get lang_section => 'Мова та тексти';
@override String get lang_title => 'Мова додатку';
@override String get lang_descr => 'Мова, в якій будуть відображатися тексти в додатку';
@override String get lang_help => 'Якщо ви хочете співпрацювати з перекладами цієї програми, ви можете звернутися до <a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>нашого посібник</ a>';
@override String get locale => 'Регіон';
@override String get locale_descr => 'Встановіть формат, який буде використовуватися для дат, чисел...';
@override String get locale_warn => 'Після зміни регіону додаток оновиться';
Expand Down Expand Up @@ -4453,6 +4456,7 @@ class _TranslationsSettingsZhTw implements _TranslationsSettingsEn {
@override String get lang_section => '語言和文本';
@override String get lang_title => '應用程式語言';
@override String get lang_descr => '應用程式中顯示文字的語言';
@override String get lang_help => '如果您想與此應用程式的翻譯合作,您可以參考<a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>我們的指南</a>';
@override String get locale => '地區';
@override String get locale_descr => '設定用於日期、數字的格式...';
@override String get locale_warn => '更改區域時應用程式將更新';
Expand Down Expand Up @@ -5900,6 +5904,7 @@ extension on Translations {
case 'settings.lang_section': return 'Language and texts';
case 'settings.lang_title': return 'App language';
case 'settings.lang_descr': return 'Language in which the texts will be displayed in the app';
case 'settings.lang_help': return 'If you want to collaborate with the translations of this app, you can consult <a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>our guide</a>';
case 'settings.locale': return 'Region';
case 'settings.locale_descr': return 'Set the format to use for dates, numbers...';
case 'settings.locale_warn': return 'When changing region the app will update';
Expand Down Expand Up @@ -6528,6 +6533,7 @@ extension on _TranslationsEs {
case 'settings.lang_section': return 'Idioma y textos';
case 'settings.lang_title': return 'Idioma de la aplicación';
case 'settings.lang_descr': return 'Idioma en el que se mostrarán los textos en la aplicación';
case 'settings.lang_help': return 'Si quieres colaborar con las traducciones de esta app puedes consultar <a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>nuestra guía</a> ';
case 'settings.locale': return 'Región';
case 'settings.locale_descr': return 'Establecer el formato a utilizar para fechas, números...';
case 'settings.locale_warn': return 'Al cambiar la región, la aplicación se actualizará';
Expand Down Expand Up @@ -7155,6 +7161,7 @@ extension on _TranslationsUk {
case 'settings.lang_section': return 'Мова та тексти';
case 'settings.lang_title': return 'Мова додатку';
case 'settings.lang_descr': return 'Мова, в якій будуть відображатися тексти в додатку';
case 'settings.lang_help': return 'Якщо ви хочете співпрацювати з перекладами цієї програми, ви можете звернутися до <a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>нашого посібник</ a>';
case 'settings.locale': return 'Регіон';
case 'settings.locale_descr': return 'Встановіть формат, який буде використовуватися для дат, чисел...';
case 'settings.locale_warn': return 'Після зміни регіону додаток оновиться';
Expand Down Expand Up @@ -7782,6 +7789,7 @@ extension on _TranslationsZhTw {
case 'settings.lang_section': return '語言和文本';
case 'settings.lang_title': return '應用程式語言';
case 'settings.lang_descr': return '應用程式中顯示文字的語言';
case 'settings.lang_help': return '如果您想與此應用程式的翻譯合作,您可以參考<a href=\'https://github.com/enrique-lozano/Monekin/tree/main/lib/i18n\'>我們的指南</a>';
case 'settings.locale': return '地區';
case 'settings.locale_descr': return '設定用於日期、數字的格式...';
case 'settings.locale_warn': return '更改區域時應用程式將更新';
Expand Down

0 comments on commit e2ccbc7

Please sign in to comment.