Add localization support and translation script

- Introduced a new extension for localization in Flutter with `LocalizationExtension` in `l10n.dart`.
- Added a Python script `translate.py` for translating ARB/JSON localization files using a local Ollama model, preserving keys and placeholders, and handling ICU format rules.
This commit is contained in:
zjs81 2026-01-11 17:13:50 -07:00
parent 2495cd840f
commit b2ce82fe7e
64 changed files with 54716 additions and 1254 deletions

View file

@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import '../l10n/l10n.dart';
class QuickSwitchBar extends StatelessWidget {
final int selectedIndex;
@ -59,18 +60,18 @@ class QuickSwitchBar extends StatelessWidget {
height: 60,
selectedIndex: selectedIndex,
onDestinationSelected: onDestinationSelected,
destinations: const [
destinations: [
NavigationDestination(
icon: Icon(Icons.people_outline),
label: 'Contacts',
icon: const Icon(Icons.people_outline),
label: context.l10n.nav_contacts,
),
NavigationDestination(
icon: Icon(Icons.tag),
label: 'Channels',
icon: const Icon(Icons.tag),
label: context.l10n.nav_channels,
),
NavigationDestination(
icon: Icon(Icons.map_outlined),
label: 'Map',
icon: const Icon(Icons.map_outlined),
label: context.l10n.nav_map,
),
],
),