This plugin create a binding between your translations from .arb files and your Flutter app.

Overview

PROJECT MAINTENANCE PAUSED

This project is no longer maintained due to the lack of time and availability. I'm a developer to and I know how frustrating can be when a tool I use no is no longer available or doesn't work any more. I'm sorry for the pain I've caused. :( Still in this repo the is a CLI tool that can work without the help of the IDE, and uses pure Dart to generate files in the same format. https://github.com/long1eu/flutter_i18n/tree/master/flutter_l10n Please give it a try, maybe it can ease your pain.

As of today I requested Intellij to remove the plugin from the market. Thanks for all the support.

Synopsis

This plugin helps you internationalize you Flutter app by generating the needed boiler plate code. You just add and organize strings in files that are contained in the /res/values folder. This plugin is based on the Internationalizing Flutter Apps tutorial and on the Material Library Localizations package. Much of the instructions are taken from there.

Usage

1. Setup you App

Setup your localizationsDelegates and your supportedLocales which allows the access to the internationalized strings.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      onGenerateTitle: (BuildContext context) => S.of(context).app_name,
      localizationsDelegates: const <LocalizationsDelegate<WidgetsLocalizations>>[
            S.delegate,
            // You need to add them if you are using the material library.
            // The material components usses this delegates to provide default 
            // localization      
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,               
      ],
      supportedLocales: S.delegate.supportedLocales,
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

Optionally, you can provide a fallback Locale for the unsupported languages in case the user changes the device language to an unsupported language. The default resolution is:

  1. The first supported locale with the same Locale.languageCode.
  2. The first supported locale.

If you want to change the last step and to provided a default locale instead of choosing the first one in you supported list, you can specify that as fallows:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      localizationsDelegates: [
            S.delegate,
            // You need to add them if you are using the material library.
            // The material components usses this delegates to provide default 
            // localization 
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: S.delegate.supportedLocales,

      localeResolutionCallback:
          S.delegate.resolution(fallback: const Locale('en', '')),
      // this is equivalent to having withCountry: false, as in the next call:
      localeResolutionCallback:
          S.delegate.resolution(fallback: const Locale('en', ''), withCountry: false),

      // - OR -

      localeListResolutionCallback:
          S.delegate.listResolution(fallback: const Locale('en', '')),    
      // this is equivalent to having withCountry: false, as in the next call:
      localeListResolutionCallback:
          S.delegate.listResolution(fallback: const Locale('en', ''), withCountry: false),

      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

2. Setup the arb files.

ARB files extension stands for Application Resource Bundle which is used by the Dart intl package. ARB files are supported by the Google Translators Toolkit, thus supported by Google.

Flutter internalization only depends on a small subset of the ARB format. Each .arb file contains a single JSON table that maps from resource IDs to localized values. Filenames contain the locale that the values have been translated for. For example, material_de.arb contains German translations, and material_ar.arb contains Arabic translations. Files that contain regional translations have names that include the locale's regional suffix. For example, material_en_GB.arb contains additional English translations that are specific to Great Britain.

The first English file is generated for you(/res/values/strings_en.arb). Every arb file depends on this one. If you have a string in the German arb file(/res/values/strings_de.arb) that has an ID which is not found in the English file, it would not be listed. So you must be sure to first have the strings in the English file and then add other translations.

To add a new arb file right click on values folder and select New -> Arb File. Then pick your language from the list, and region if necessary.

1. Referencing the values

The ARB table's keys, called resource IDs, are valid Dart variable names. They correspond to methods from the S class. For example:

Widget build(BuildContext context) {
  return new FlatButton(
    child: new Text(
      S.of(context).cancelButtonLabel,
    ),
  );
}

2. Parameterized strings

Some strings may contain $variable tokens which are replaced with your values. For example:

{   
    "aboutListTileTitle": "About $applicationName"  
}

The value for this resource ID is retrieved with a parameterized method instead of a simple getter:

S.of(context).aboutListTileTitle(yourAppTitle)

3. Plurals

Plural translations can be provided for several quantities: 0, 1, 2, "few", "many", "other". The variations are identified by a resource ID suffix which must be one of "Zero", "One", "Two", "Few", "Many", "Other" (case insensitive). The "Other" variation is used when none of the other quantities apply. All plural resources must include a resource with the "Other" suffix. For example the English translations ('material_en.arb') for selectedRowCountTitle in the Material Library Localizations are:

{
    "selectedRowCountTitleZero": "No items selected",
    "selectedRowCountTitleMany": "to many items", //not actual real
    "selectedRowCountTitleOne": "1 item selected",
    "selectedRowCountTitleOther": "$selectedRowCount items selected",</pre>
}

Then, we can reference these strings as follows:

S.of(context).selectedRowCountTitle("many")

or

S.of(context).selectedRowCountTitle("1")

or

S.of(context).selectedRowCountTitle("$selectedRowCount")

3. Turning off the plugin per project.

With the release of v1.1.0 of the plugin, it is possible to turn on or off the plugin per project by adding a new top-level configuration option in your project's pubspec.yaml file: flutter_i18n

The plugin will be turned off by default for Dart-only projects, and on by default for Flutter projects. To change this setting, however, you have two options under the top-level flutter_i18n configuration:

enable-flutter-i18n: true / false

To activate the plugin for a Flutter project. The default setting is true.

enable-for-dart: true / false

To activate the plugin for a Dart-only project. The default setting is false.

NOTES:

  • The plugin also supports ${variable} notation. Use this when the parser does not catch the parameters properly. For example:

    {"tabLabel": "탭 $tabCount개 중 $tabIndex번째"}

    generates

    String tabLabel(String tabCount개, String tabIndex번째) => "탭 $tabCount개 중 $tabIndex번째";

    Which contains invalid Dart fields. In this case you should use

    {"tabLabel": "탭 ${tabCount}개 중 ${tabIndex}번째"}
  • Also you can escape the $ sign with \

    {"checkout_message": "You have to pay \$$price"}

Issues

There are some performance improvements and bug fixes that this plugin could use, so feel free to PR.

Comments
  • Getting error in Plugin.

    Getting error in Plugin.

    I 'm getting following error when my application is started. And i18n file is not generated. kotlin.KotlinNullPointerException at eu.long1.flutter.i18n.files.FileHelpers.getI18nFile(FileHelpers.kt:20) at eu.long1.flutter.i18n.workers.I18nFileGenerator.generate(I18nFileGenerator.kt:54) at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.compute(actions.kt:64) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945) at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1.run(Timer.kt:150) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)

    bug duplicate 
    opened by as001622 25
  • Localizations no longer works after upgrade to the latest version of flutter i18n plugin

    Localizations no longer works after upgrade to the latest version of flutter i18n plugin

    Hi to all, on a my Flutter app I use the flutter i18n plugin for texts localizations, with two supported languages: Italian and English (the English is also the fallback language). This localizations until a few days ago worked properly, but after the upgrade of the i18n plugin to the latest version 0.1.1 it stopped working, and all the app's texts are now always displayed in English (the fallback language ) even if on my Android device the language is set to Italian ('it'), and before this upgrade the texts were correctly localized in Italian.

    I did not change anything in the code, but I realized that now, if I call (for test) Localizations.localeOf (context), it always returns the 'en_' Locale, even if on the device I set the French language or Italian language, or any other language other than English.

    This is clearly a mistake. I'm not sure, but I think this error came out after upgrading to version 0.1.1 of the flutter i18n plugin in my Android Studio (version 3.2.1) development environment.

    Steps to Reproduce

    This is the interestings code:

    @override
      Widget build(BuildContext context) {
        Locale currentLocale = Localizations.localeOf(context);
        String localizationLanguageCode = S.delegate.isSupported(currentLocale) ? currentLocale.languageCode : Config.defaultLanguageCode;
        print('currentLocale is: ${currentLocale.toString()}, currentLocale.languageCode is: ${currentLocale.languageCode}, localizationLanguageCode is: $localizationLanguageCode');
        return MaterialApp(
          localizationsDelegates: [
            S.delegate,
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
          ],
          supportedLocales: S.delegate.supportedLocales,
          localeResolutionCallback: S.delegate.resolution(fallback: new Locale('${Config.defaultLanguageCode}', '')),
          home: Scaffold(
            appBar: _makeAppBar(context),
            body: FutureBuilder<List<Lesson>>(
              future: fetchLessons(http.Client(), selectedCourse, localizationLanguageCode),
              //future: listLessons,
              builder: (context, snapshot) {
                this.numBuild++;
                print('number of build of LessonsRoute: ${this.numBuild}...');
                if (snapshot.hasError)  {
                  print('Snaphot has the following error: ${snapshot.error}');
                  return Center(
                      child: Text('Snaphot has the following error: ${snapshot.error}')
                  );
                } else {
                  if (snapshot.hasData) {
                    if (snapshot.data != null && courses != null) {
                      return ListViewLessons(lessons: snapshot.data, courses: courses);
                    } else {
                      return Center(child: Text('snapshot.data is null or/and courses is null!'));
                    }
                  } else {
                    return Center(child: CircularProgressIndicator());
                  }
                }
              },
            ),
          ),
        );
      }
    

    In the above code, the following test instructions:

     Locale currentLocale = Localizations.localeOf(context);
     String localizationLanguageCode = S.delegate.isSupported(currentLocale) ? currentLocale.languageCode : Config.defaultLanguageCode;
     print('currentLocale is: ${currentLocale.toString()}, currentLocale.languageCode is: ${currentLocale.languageCode}, localizationLanguageCode is: $localizationLanguageCode');
    

    Produces the following result: `I/flutter ( 4432): currentLocale is: en_, currentLocale.languageCode is: en, localizationLanguageCode is: en

    But, on my device (Samsung Galaxy S5 with Android 6.0.1) the language is set to Italian, not to English! See attached screenshots. Even with the ADVs emulators, I now have the same problem.

    So, it seems that some internal i18n call to Localizations.localeOf (context) or similar, returns now a wrong result (always English Locale), which prevents localizations in other languages.

    What happened? How can I make the localizations of texts on my app work again?

    Also, referring to (https://github.com/flutter/flutter/issues/24747) might help which probably explains what broke flutter_i18n?

    Thanks in advance for the help you want to give me.

    Flutter Doctor

    [v] Flutter (Channel beta, v0.11.9, on Microsoft Windows [Versione 10.0.17134.407], locale it-IT)
        • Flutter version 0.11.9 at c:\src\flutter
        • Framework revision d48e6e433c (2 days ago), 2018-11-20 22:05:23 -0500
        • Engine revision 5c8147450d
        • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
    
    [v] Android toolchain - develop for Android devices (Android SDK 28.0.3)
        • Android SDK at C:\Users\lucio\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-28, build-tools 28.0.3
        • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
        • All Android licenses accepted.
    
    [v] Android Studio (version 3.2)
        • Android Studio at C:\Program Files\Android\Android Studio1
        • Flutter plugin version 30.0.1
        • Dart plugin version 181.5656
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    
    [v] Connected device (1 available)
        • SM G900F • 5fe4af7d • android-arm • Android 6.0.1 (API 23)
    
    • No issues found!
    
    

    flutter_02

    deployment 
    opened by LucioD 25
  • The getter '{string_key}' was called on null.

    The getter '{string_key}' was called on null.

    static S of(BuildContext context) => Localizations.of<S>(context, S); , this call returns null so the usage like will produce the exception The getter '{string_key}' was called on null.

    opened by ammar-esrawi 14
  • NoSuchMethodError

    NoSuchMethodError

    When I try to use the plugin I got that error....do I make something wrong or is it the plugin??

    I/flutter (30012): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter (30012): The following NoSuchMethodError was thrown building MyApp(dirty): I/flutter (30012): The getter '_locale' was called on null. I/flutter (30012): Receiver: null I/flutter (30012): Tried calling: _locale I/flutter (30012): I/flutter (30012): When the exception was thrown, this was the stack: I/flutter (30012): #0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46) I/flutter (30012): #1 S.of (package:bill_scanner/generated/i18n.dart:20:25)

    class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return new MaterialApp( title: 'Flutter Demo', localizationsDelegates: [S.delegate], supportedLocales: S.delegate.supportedLocales, localeResolutionCallback: S.delegate.resolution(fallback: new Locale("en", "")), theme: new ThemeData( // This is the theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload" (press "r" in the console where you ran "flutter run", // or press Run > Flutter Hot Reload in IntelliJ). Notice that the // counter didn't reset back to zero; the application is not restarted. primarySwatch: Colors.blue, ), home: new MyHomePage(title: "test title"), ); } }

    floatingActionButton: new FloatingActionButton( onPressed: _incrementCounter, tooltip: S.of(context).title, child: new Icon(Icons.add), ), // This trailing comma makes auto-formatting nicer for build methods.

    opened by swissonid 12
  • Change Language at run time from other Screen

    Change Language at run time from other Screen

    My question is similar to https://github.com/long1eu/flutter_i18n/issues/15. But have an issue understanding it as it's not similar to the class generated by the plugin.

    The gist shows changing the language from the Main/Home screen. In my I have a settings screen and user can change their language. When a language is selected, the new language should be reflected.

    I am using the below code in my Settings page, when the user changes the language. But it does not have any effect.

    S.delegate.load(new Locale(value));

    what I am doing wrong? What is the right approach? Thanks in advance.

    question 
    opened by Purus 10
  • java.lang.AssertionError: Already disposed: Project (Disposed) xxxxxxx

    java.lang.AssertionError: Already disposed: Project (Disposed) xxxxxxx

    java.lang.AssertionError: Already disposed: Project (Disposed) xxxxxxx
    	at com.intellij.openapi.components.impl.ComponentManagerImpl.lambda$throwAlreadyDisposed$1(ComponentManagerImpl.java:248)
    	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:955)
    	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
    	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
    	at com.intellij.openapi.components.impl.ComponentManagerImpl.throwAlreadyDisposed(ComponentManagerImpl.java:246)
    	at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:239)
    	at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:149)
    	at com.intellij.psi.PsiManager.getInstance(PsiManager.java:39)
    	at eu.long1.flutter.i18n.workers.I18nFileGenerator.<init>(I18nFileGenerator.kt:22)
    	at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.compute(actions.kt:70)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945)
    	at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1.run(Timer.kt:146)
    	at java.util.TimerThread.mainLoop(Timer.java:555)
    	at java.util.TimerThread.run(Timer.java:505)
    
    bug enhancement 
    opened by csshuai 10
  • How can I add text after a parameter?

    How can I add text after a parameter?

    I am looking to add a string like "Weight: 20Kg" where 20 should be parameterised and followed by "Kg" without a separating space, however writing something like "Weight: $weightKg" ends up with a variable called weightKg and "Weight: ${weight}Kg" results in a function with bas syntax (missing argument name). Is there a way to overcome this?

    opened by talmor-guy 10
  • Uncaught exception in plugin

    Uncaught exception in plugin

    Got this error - might be an easy one given the assertion message:

    java.lang.Throwable: Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction())
    	at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:180)
    	at com.intellij.openapi.application.impl.ApplicationImpl.assertWriteAccessAllowed(ApplicationImpl.java:1283)
    	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.processEvent(PersistentFSImpl.java:686)
    	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.createChildDirectory(PersistentFSImpl.java:436)
    	at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.createChildDirectory(VirtualFileSystemEntry.java:283)
    	at eu.long1.flutter.i18n.files.FileHelpers.getResourceFolder(FileHelpers.kt:11)
    	at eu.long1.flutter.i18n.files.FileHelpers.getValuesFolder(FileHelpers.kt:15)
    	at eu.long1.flutter.i18n.workers.I18nFileGenerator.<init>(I18nFileGenerator.kt:24)
    	at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.compute(actions.kt:74)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:922)
    	at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1.run(Timer.kt:150)
    	at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    	at java.base/java.util.TimerThread.run(Timer.java:506)
    
    bug good first issue 
    opened by Lootwig 8
  • Issue with Android Studio: Write access is allowed inside write-action only

    Issue with Android Studio: Write access is allowed inside write-action only

    Got this exception on a project without fiddling with misc.xml or anything else. Just installed the plugin and the error popped out.

    Android Studio 3.3.1 Build #AI-182.5107.16.33.5264788, built on January 28, 2019 JRE: 1.8.0_152-release-1248-b01 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.14.3

    java.lang.Throwable: Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction()) at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:169) at com.intellij.openapi.application.impl.ApplicationImpl.assertWriteAccessAllowed(ApplicationImpl.java:1345) at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.processEvent(PersistentFSImpl.java:686) at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.createChildFile(PersistentFSImpl.java:450) at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.createChildData(VirtualFileSystemEntry.java:217) at com.intellij.openapi.vfs.VirtualFile.findOrCreateChildData(VirtualFile.java:322) at eu.long1.flutter.i18n.files.FileHelpers.getI18nFile(FileHelpers.kt:23) at eu.long1.flutter.i18n.workers.I18nFileGenerator.generate(I18nFileGenerator.kt:54) at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.compute(actions.kt:64) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945) at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1.run(Timer.kt:150) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)

    Edit to fix formatting.

    question 
    opened by ammachado 8
  • Cannot Undo

    Cannot Undo

    I get an error message if I try to undo (hit cmd-z) after using translated strings in my .dart-files. It happens every time after the i18n.dart got autogenerated. I thought if there's any way to... maybe generate the i18n.dart manually?

    Cannot_Undo_und_murumate___Applications_MAMP_htdocs_flutter_murumate_murumate__-____lib_widgets_default_dialogs_dart__murumate

    question wontfix 
    opened by cr33zy 7
  • How to change language promatically

    How to change language promatically

    I use this plug-in can change language when app start-up.

    But if I want to change language programmatically, who to do so.

    ex: change language when I click a button.

    thanks a lot :)

    opened by falll2000 7
  • JsonFileTypeFactory was removed in IntelliJ 2019.3.

    JsonFileTypeFactory was removed in IntelliJ 2019.3.

    After the 2019.03 update, I got the following error:

    com.intellij.diagnostic.PluginException: While loading class eu.long1.flutter.i18n.arb.ArbFileTypeFactory: com/intellij/json/JsonFileTypeFactory [Plugin: FlutterI18n]
    	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:223)
    	at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:167)
    	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    	at java.base/java.lang.Class.forName0(Native Method)
    	at java.base/java.lang.Class.forName(Class.java:398)
    	at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getImplementationClass(ExtensionComponentAdapter.java:80)
    	at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:39)
    	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:63)
    	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:442)
    	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:429)
    	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:290)
    	at com.intellij.openapi.extensions.ExtensionPointName.processWithPluginDescriptor(ExtensionPointName.java:157)
    	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.initStandardFileTypes(FileTypeManagerImpl.java:358)
    	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.<init>(FileTypeManagerImpl.java:228)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    	at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:44)
    	at com.intellij.serviceContainer.PlatformComponentManagerImpl.instantiateClassWithConstructorInjection(PlatformComponentManagerImpl.kt:505)
    	at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:52)
    	at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:39)
    	at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:110)
    	at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:72)
    	at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:65)
    	at com.intellij.serviceContainer.PlatformComponentManagerImpl$preloadServices$future$1.run(PlatformComponentManagerImpl.kt:622)
    	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
    	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:222)
    	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
    	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:201)
    	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:193)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:834)
    Caused by: java.lang.NoClassDefFoundError: com/intellij/json/JsonFileTypeFactory
    	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)
    	at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:359)
    	at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:355)
    	at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:319)
    	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:220)
    	... 34 more
    Caused by: java.lang.ClassNotFoundException: com.intellij.json.JsonFileTypeFactory PluginClassLoader[FlutterI18n, 0.0.6+1] com.intellij.ide.plugins.cl.PluginClassLoader@1e8c22ae
    	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    	... 41 more
    

    In the IJ 2019.03 API Changelog, I could find a replacement for com.intellij.json.JsonFileTypeFactory with com.intellij.fileType. https://github.com/JetBrains/intellij-sdk-docs/blob/master/reference_guide/api_changes/api_changes_list_2019.md

    ..and I found a class in this project that extend JsonFileTypeFactory. https://github.com/long1eu/flutter_i18n/blob/c8a26c6cdc28c12b94a280617d3838f09847c9bb/src/main/kotlin/eu/long1/flutter/i18n/arb/ArbFileTypeFactory.kt

    opened by junghyun397 1
  • Can methods with parameters be made optional?

    Can methods with parameters be made optional?

    Different languages have different expression styles,like this: English: If the last price rises to or above $name1,an order to buy $name3 at a price of $name2 will be placed Chinese: 若价格高于${name1}时,则依据${name2}下单,购买${name3} The name1 name2 name3 in different order,generate method is English: (String name1, String name3, String name2) Chinese: (String name1, String name2, String name3) Inconvenient to pass values,Whether it can be modified to ({String name1,String name3,String name2}),so it Can be called like this,(name1:'hello',name2:'hello',name3:'hello')

    opened by sxiaoming2007 0
  • plugin stopped recognizing arb files' contents

    plugin stopped recognizing arb files' contents

    tons of constants suddenly became useless... very buggy plugin, some of the features like string extraction don't work at all. the issues are hardly ever reviewed terrible experience

    kotlin.KotlinNullPointerException
    	at eu.long1.flutter.i18n.workers.I18nFileGenerator.generate(I18nFileGenerator.kt:57)
    	at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1$1.compute(actions.kt:74)
    	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$19(ApplicationImpl.java:1065)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1021)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1065)
    	at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.run(Initializer.kt:286)
    	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
    	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
    	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
    	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    	at java.awt.EventQueue.access$500(EventQueue.java:98)
    	at java.awt.EventQueue$3.run(EventQueue.java:715)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:757)
    	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:706)
    	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:375)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    
    opened by VadimOsovsky 0
  • Run plugin from terminal?

    Run plugin from terminal?

    Hi, this is indeed a great plugin. But is there a way to run this from the terminal?

    We have this requirement to generate different localization for different product flavors during runtime in the CI. Basically we will provide different arb files and expect the corresponding i18n.dart to be generated. But opening android studio during the build process doesn't seem feasible in this case. Is there an intl_translation-ish pub library that we can execute from the terminal? Thanks

    opened by PandaGeek1024 0
Releases(v1.0)
Owner
Razvan Lung
https://www.linkedin.com/in/long1eu
Razvan Lung
Binding and high-level wrapper on top of libssh - The SSH library!

Dart Binding to libssh version 0.9.6 binding and high-level wrapper on top of libssh - The SSH library! libssh is a multiplatform C library implementi

Isaque Neves 2 Dec 20, 2021
Aris wasmjsextend - Binding generator for FFI bindings

Binding generator for FFI bindings. Note: ffigen only supports parsing C headers

Behruz Hurramov 1 Jan 9, 2022
Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your device and upload them to Firebase.

Flutter Tutorial - Upload Files To Firebase Storage Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your devic

Johannes Milke 30 Dec 28, 2022
A simple Android Application built with :heart: using Flutter, for transferring files between devices.

transferz A simple Android Application built with ❤️ using Flutter, for transferring files between devices. Putting ⭐ will be highly appreciated ?? .

Anjan Roy 86 Dec 17, 2022
Download files from Firebase Storage with Flutter. List all images, videos, or other files from Firebase and download them.

Flutter Tutorial - Download Files From Firebase Storage Download files from Firebase Storage with Flutter. List all images, videos, or other files fro

Johannes Milke 28 Dec 4, 2022
Flutter plugin that provides a quick&dirty workaround for incompatibility between VMWare Airwatch MDM solution and Dart Sockets implementation

airwatch_socket_workaround This plugin has been created to enable flutter apps to reach endpoints that are only reachable using a VMWare airwatch per

Gonçalo Silva 5 Nov 11, 2022
Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.

Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.

Vehement 8 Nov 26, 2022
Allows communication between your bot and the Web App built in Flutter displayed inside Telegram.

tele_web_app It enables communication between your bot and the Flutter-embedded Web App displayed inside Telegram by making use of interoperability be

Yeikel Uriarte Arteaga 16 Dec 8, 2022
Flutter plugin (android) for sharing bytes and files Offline, (Based on the android Nearby Connections API)

nearby_connections An android flutter plugin for the Nearby Connections API Currently supports Bytes and Files. Transfer Data between multiple connect

Prerak Mann 63 Nov 21, 2022
A flutter plugin for viewing PDF files in mobile app (Android & iOS)

PDF Viewer (JK) A flutter plugin for viewing PDF files in mobile app (Android & iOS) Pub.dev https://pub.dev/packages/pdf_viewer_jk Github ht

Jawad 8 Sep 30, 2021
A flutter plugin for handling PDF files

advance_pdf_viewer A flutter plugin for handling PDF files. Works on both Android & iOS. Originally forked from (https://github.com/CrossPT/flutter_pl

Abeer Iqbal 0 Dec 3, 2021
A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux & Android.

flutter_media_metadata A Flutter plugin to read metadata of media files. A part of Harmonoid open source project ?? Install Add in your pubspec.yaml.

Harmonoid 60 Dec 2, 2022
A Flutter plugin for sharing files & text with other applications.

esys_flutter_share A Flutter plugin for sharing files & text with other applications. IMPORTANT Note for iOS If you are starting a new fresh app, you

ESYS GmbH 134 Sep 28, 2022
Access links between your devices in real time!

Lineker Description Lineker allows you to manage links between your desktop and smartphone in real time, saving and deleting at any time. Create filte

Blackoutseeker 2 Aug 5, 2022
Pasar parametros - App to practice navigation between screens and passing parameters from A->B and B->A

App 5 App para practicar navegacion entre pantallas y paso de parametros de A->B

null 1 Feb 6, 2022
Riverpod State Mgmt for Flutter. StateProviders, StateNotifierProviders, FutureProviders, StreamProviders, autodisposed and families, and everything in-between.

Flutter Riverpod Learning/Reference zone A Null-Safety flutter project acting as a learning/code reference zone Based on Riverpod (v1/v2) Page Transit

Lexx YungCarter 8 Dec 24, 2022
Intel Corporation 238 Dec 24, 2022
DostiPak - Dating app to make connection between people and start new love story to lovers

Dosti Pak Dating app to make connection between people and start new love story

ABDULKARIM ALBAIK 6 Oct 2, 2022
A Flutter Material Button that animates between Progress and Error states

progress_button A Material Flutter Button that supports progress and error visuals Getting Started ProgressButton is designed to be easy to use and cu

Halil Ozercan 132 Sep 21, 2022