-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added null safety support #26
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,22 +25,22 @@ I18nOption _generateI18Option(List<String> args) { | |
return i18nOption; | ||
} | ||
|
||
ArgParser _generateArgParser(I18nOption i18nOption) { | ||
ArgParser _generateArgParser(I18nOption? i18nOption) { | ||
var parser = new ArgParser(); | ||
|
||
parser.addOption('source-dir', | ||
defaultsTo: 'res/string', | ||
callback: (String x) => i18nOption.sourceDir = x, | ||
callback: (String? x) => i18nOption!.sourceDir = x, | ||
help: 'A source folder contains all string json files'); | ||
|
||
parser.addOption('output-dir', | ||
defaultsTo: 'lib/generated', | ||
callback: (String x) => i18nOption.outputDir = x, | ||
callback: (String? x) => i18nOption!.outputDir = x, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if (I18nOption == null) this will throw an error |
||
help: 'A output folder stores all generated files'); | ||
|
||
parser.addOption('template-locale', | ||
defaultsTo: 'en', | ||
callback: (String x) => i18nOption.templateLocale = x, | ||
callback: (String? x) => i18nOption!.templateLocale = x, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if (I18nOption == null) this will throw an error |
||
help: | ||
'Use string_{template-locale}.json as a template for default value when a locale does not exist. If string_en does not exist, this script will use the first string json file as a template'); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
package com.kingwu.genlangexample | ||
|
||
import android.os.Bundle | ||
|
||
import io.flutter.app.FlutterActivity | ||
import io.flutter.plugins.GeneratedPluginRegistrant | ||
import io.flutter.embedding.android.FlutterActivity | ||
|
||
class MainActivity: FlutterActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
GeneratedPluginRegistrant.registerWith(this) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.enableR8=true | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
# This is a generated file; do not edit or check into version control. | ||
export "FLUTTER_ROOT=/home/vader/Android/flutter" | ||
export "FLUTTER_APPLICATION_PATH=/home/vader/Linos/Project/gen_lang/example" | ||
export "FLUTTER_TARGET=lib/main.dart" | ||
export "FLUTTER_BUILD_DIR=build" | ||
export "SYMROOT=${SOURCE_ROOT}/../build/ios" | ||
export "FLUTTER_BUILD_NAME=1.0.0" | ||
export "FLUTTER_BUILD_NUMBER=1" | ||
export "DART_OBFUSCATION=false" | ||
export "TRACK_WIDGET_CREATION=false" | ||
export "TREE_SHAKE_ICONS=false" | ||
export "PACKAGE_CONFIG=.packages" |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"genderMessageFemale":"Hola ${name}, ella es una chica.", | ||
"genderMessageGOther":"Hola ${name}, el/ella es chico/chica.", | ||
"genderMessageMale":"Hola ${name}, él es u chico.", | ||
"locale":"Spanish", | ||
"messageWithParams":"Hola ${yourName}, bienvenido!", | ||
"pluralMessageOne":"Hola ${interviewerName}, tengo un año de experiencia laboral.", | ||
"pluralMessagePOther":"Hola ${interviewerName}, Tengo ${howMany} años de experiencia laboral.", | ||
"simpleMessage":"Este es un mensaje sencillo", | ||
"specialCharactersMessage":"Caracteres Especiales Buenos Desarrolladores \"Mensaje\"\n Siguiente Línea" | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (I18nOption == null) this will throw an error