goodjob_language 1.0.3 copy "goodjob_language: ^1.0.3" to clipboard
goodjob_language: ^1.0.3 copied to clipboard

outdated

Goodjob-SDK是为了满足国际化翻译,实现了一键配置翻译结果同步到应用上,使开发者在开发过程中不再需要关注于文案的翻译和撰写,能将更大的精力放在研发上。

中文

Account registration #

1.Please log in https://goodjob.ai/ apply to be a developer

2.The panel bar choose to create a new project

img

3.View the generated apiKey and apiSecret personal center.

SDK-Flutter #

Method #

dependencies:
  goodjob_language: ^latest_version

Use #

  1. init sdk
GoodJobBusiness _business = GoodJobBusiness.getInstance();
var res =  await _business.initSDK(
     apiKey: "goodjob_api_key",
     apiSecret: "goodjob_api_secret",
     id: '10133',
     isDebug: true);
    
  1. Get results for translation

KeyName needs and goodjob configuration with the name of the one to one correspondence, such as the need to modify please operate in the background, Chinese by default

var res = await _business.interpret(keyName);

Switch language

_business.switchLanguage(language: lang);

To obtain a list has added languages

_business.getLanguageList();

More #

If you want to control the state of the global change, it is suggested that local manually import the provider library

dependencies:
  provider: ^4.0.5

Provider document

In order to 4.0.5 As an example:

  1. define Counter
class Counter with ChangeNotifier,DiagnosticableTreeMixin{
  String _key10 = "";
  String get key10 => _key10;
  void initCounter({String lang}) async {
    GoodJobBusiness _business = GoodJobBusiness.getInstance();
    if (lang != null) {
      _business.switchLanguage(language: lang);
    }
    _key10 = await _business.interpret("key10");
    notifyListeners();
  }  
}
  1. Modify the App in the main entrance
void main() {
  runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider(create: (_) => Counter()),
    ],
    child: MyApp(),
  ));
}
  1. use
Text('${Provider.of<Counter>(context).key10}')
5
likes
0
pub points
0%
popularity

Publisher

verified publishergoodjob.ai

Goodjob-SDK是为了满足国际化翻译,实现了一键配置翻译结果同步到应用上,使开发者在开发过程中不再需要关注于文案的翻译和撰写,能将更大的精力放在研发上。

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, dio, dio_http_cache, flutter, path, quiver, sqflite

More

Packages that depend on goodjob_language