question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Translations errors in cordova 5

See original GitHub issue

Hi! This plugin is missing some translations… With the latest cordova (that uses gradle) it generates errors and fails to build…

Solutions:

  1. Set an empty value: <string name="discard"></string> in all of the missing translatins, for exemple: src/android/Library/res/values-de/multiimagechooser_strings_de.xml
  2. Set a default: <string name="discard">NOT TRANSLATED</string> in all of the missing translatins, for exemple: src/android/Library/res/values-de/multiimagechooser_strings_de.xml
  3. Use the google translator translations: <string name="discard">Stornieren</string> in all of the missing translatins, for exemple: src/android/Library/res/values-de/multiimagechooser_strings_de.xml
  4. Ignore it: <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation" > in src/android/Library/res/values/multiimagechooser_strings_en.xml
  5. Delete all the translations: in src/android/Library/res/delete all the folders matching this “values-*”

I can make a pull request with one of the solutions., What would be the best way to solve this problem?

Some debug/errors shown:

...
:mergeReleaseResources UP-TO-DATE
:processReleaseManifest UP-TO-DATE
:processReleaseResources UP-TO-DATE
:generateReleaseSources UP-TO-DATE
:compileReleaseJava UP-TO-DATE
:lintVitalRelease/home/unknown/myApp/platforms/android/res/values/multiimagechooser_strings_en.xml:7: Error: "discard" is not translated in "es" (Spanish), "fr" (French), "hu" (Hungarian), "ja" (Japanese), "ko" (Korean) [MissingTranslation]
    <string name="discard">Cancel</string>
            ~~~~~~~~~~~~~~
/home/unknown/myApp/platforms/android/res/values/multiimagechooser_strings_en.xml:8: Error: "done" is not translated in "es" (Spanish), "fr" (French), "hu" (Hungarian), "ja" (Japanese), "ko" (Korean) [MissingTranslation]
    <string name="done">OK</string>
            ~~~~~~~~~~~
/home/unknown/myApp/platforms/android/res/values/strings.xml:3: Error: "app_name" is not translated in "de" (German), "es" (Spanish), "fr" (French), "hu" (Hungarian), "ja" (Japanese), "ko" (Korean) [MissingTranslation]
    <string name="app_name">myApp</string>
            ~~~~~~~~~~~~~~~
/home/unknown/myApp/platforms/android/res/values/strings.xml:4: Error: "launcher_name" is not translated in "de" (German), "es" (Spanish), "fr" (French), "hu" (Hungarian), "ja" (Japanese), "ko" (Korean) [MissingTranslation]
    <string name="launcher_name">@string/app_name</string>
            ~~~~~~~~~~~~~~~~~~~~
/home/unknown/myApp/platforms/android/res/values/strings.xml:5: Error: "activity_name" is not translated in "de" (German), "es" (Spanish), "fr" (French), "hu" (Hungarian), "ja" (Japanese), "ko" (Korean) [MissingTranslation]
    <string name="activity_name">@string/launcher_name</string>
            ~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "MissingTranslation":
   If an application has more than one locale, then all the strings declared
   in one language should also be translated in all other languages.

   If the string should not be translated, you can add the attribute
   translatable="false" on the <string> element, or you can define all your
   non-translatable strings in a resource file called donottranslate.xml. Or,
   you can ignore the issue with a tools:ignore="MissingTranslation"
   attribute.

   By default this detector allows regions of a language to just provide a
   subset of the strings and fall back to the standard language strings. You
   can require all regions to provide a full translation by setting the
   environment variable ANDROID_LINT_COMPLETE_REGIONS.

   You can tell lint (and other tools) which language is the default language
   in your res/values/ folder by specifying tools:locale="languageCode" for
   the root <resources> element in your resource file. (The tools prefix
   refers to the namespace declaration http://schemas.android.com/tools.)

5 errors, 0 warnings
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

  To proceed, either fix the issues identified by lint, or modify your build script as follows:
  ...
  android {
      lintOptions {
          checkReleaseBuilds false
          // Or, if you prefer, you can continue to check for errors in release builds,
          // but continue the build even when errors are found:
          abortOnError false
      }
  }
  ...

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9

github_iconTop GitHub Comments

4reactions
jiuyuehecommented, Dec 7, 2015

这种半吊子水平还搞什么国际化,去掉src/android/Library/res/下面的各种语言。配置文件即可

2reactions
david-yoshicommented, Oct 27, 2015

Need more detail on how to do it. What files need to be edited etc. For example I finally fixed it by adding

lintOptions { disable ‘MissingTranslation’ }

to the android{} block in build.gradle

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when running cordova build –release android
I can run ionic build android and deploy to an emulator without problem. I've tried searching for lintOptions and build.gradle but I can't...
Read more >
How to translate in Ionic 5 - Internationalization and Localization
In this post you'll learn how to translate text in Ionic 5 apps and PWA. You will also learn how to get device...
Read more >
Blog - Apache Cordova
Including: archive all existing translated documentation to a new static archive site; remove all translations from the main repo, and update ...
Read more >
Can't build android project after using phonegap-plugin ...
Hey, I got an error after add phonegap-plugin-barcodescanner plugin ... ionic platform add android cordova build --release android It seems w…
Read more >
Camera API Plugin: Capacitor and Cordova for Ionic Apps
The Capacitor/Cordova Camera API plugin lets users take photos, ... DATA_URL can be very memory intensive and cause app crashes or out of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found