Lint: How to ignore "<key> is not translated in <language>" errors? - eclipse

I can't compile/debug our Android app, because the localization files are not perfect yet.
My IDE's validation tool Lint create errors saying:
newCardsOrderVals is not translated in ar, bg, ca, cs
Compiling/installing/running with Ant works fine, but I would like to use my IDE to ease debugging.
Is there a way to turn off this particular check, or ideally make it a warning rather than an error?
I understand that before release we will really need to get localisation files right, but for the time being it is not a priority as the screens themselves are being modified very frequently.

Android Studio:
"File" > "Settings" and type "MissingTranslation" into the search box
Eclipse:
Windows/Linux: In "Window" > "Preferences" > "Android" > "Lint Error Checking"
Mac: "Eclipse" > "Preferences" > "Android" > "Lint Error Checking"
Find the MissingTranslation line, and set it to Warning as seen below:

You can set the attribute translatable="false" on the definition like this:
<string name="account_setup_imap" translatable="false">IMAP</string>
For more information: http://tools.android.com/recent/non-translatablestrings

To ignore this in a gradle build add this to the android section of your build file:
lintOptions {
disable 'MissingTranslation'
}

This will cause Lint to ignore the missing translation error for ALL strings in the file, yet other string resource files can be verified if needed.
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation">

If you want to turn off the warnings about the specific strings, you can use the following:
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--suppress MissingTranslation -->
<string name="some_string">ignore my translation</string>
...
</resources>
If you want to warn on specific strings instead of an error, you will need to build a custom Lint rule to adjust the severity status for a specific thing.
http://tools.android.com/tips/lint-custom-rules

Insert in the lint.xml file this:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
...
<issue
id="MissingTranslation"
severity="ignore" />
</lint>
For more details: Suppressing Lint Warnings.

add the lines in your /res/values.xml file in resource root tab like this:
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:locale="en" tools:ignore="MissingTranslation">
tools:locale set the local language to English, no need of language translation later on that for all resource strings and tools:ignore let Lint to isnore the missing translations of the resource string values.

Add following to your gradle file in android section
lintOptions {
disable 'MissingTranslation'
}

In addition,
Not project dependent properities, Eclipse Preferences.
In Mac, Eclipse > Preferences

Another approach is to indicate the languages you intend to support and filter out the rest using the 'resConfigs' option with Gradle.
Check out this other answer for details
This is better, I think, because you don't have to completely ignore legitimate translation mistakes for languages you actually want to support

You can also put resources which you do not want to translate to file called donottranslate.xml.
Example and explanation: http://tools.android.com/recent/non-translatablestrings

Many of them has a given a different working answers, and i too got the same lint errors
i make it ignore by doing the following with eclipse.
click on Windows
click on preferences
select android > Lint Error Checking.
click on ignore All > Apply > Ok.
Thats it.

The following worked for me.
Click on Windows
Click on preferences
Select android > Lint Error Checking.
Find and select the relevant Lint checking and
Set the severity to 'Ignore' (on bottom right)

Related

False positive "Missing include" xslt error in eclipse

I have an xslt file in my eclipse project.
The xslt is run using a custom processor, which contains some xslt files as an in-jar resource. The xslt linter does not see those resources, and signals an error.
The offending line in the xslt code:
<xsl:include href="xslt/functions.xslt"/>
The error message:
Missing include: xslt/functions.xslt
I guess that the xslt path for the linter is somehow configureable, but cannot find where and how.
Where and how?
If using the Eclipse XSL Editor (there are also other XSLT editors for Eclipse):
Window > Preferences: XML > XSL > Validation
or on project level:
Project > Properties: Validation > XSLT Validation
It is possible with the XML-Catalog-function "Rewrite Entry" and the imports having a prefix which identifies the folder you want to take the import from.
Window > Preferences : XML > XML Catalog > Rewrite Entry
You have to provide a URI key type and the prefix of the href-value.
Rewrite it with a "file://xxxx" value and the import gets resolved.
Example:
<xsl:include href="imp://xslt/functions.xslt"/>
catalog-rewrite-entry for eclipse
Entry element: Rewrite
Start string: imp://
Rewrite prefix: file:///home/xxx/project/importfolder
Key type: URI

Validating issue: Unknown Tag/Undefined attribute name warnings in Eclipe

The following code presents validation issues for me in Eclipse 4.4.2. This is located in a JSP file.
<svg version="1.1" class="..." xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="..." y="..." width="..x" height="..." viewBox="..."
enable-background="..." xml:space="...">
<g>
<polygon fill="#FFFFFF" points="..."></polygon>
<polygon fill="#FFFFFF" points="..."></polygon>
</g>
</svg>
This code produces the following warnings:
"Undefined attribute name (attribute-name)" for every attribute attached to the svg element
"Unknown tag (tag-name)" for the g and polygon tags.
I ran this through an online validator that supports HTML5/SVG1.1, and it told me there were 0 validation issues.
Any ideas why this could be happening? I'm aware that I can choose to ignore the validation issues through Window > Preferences > Validation, but I would prefer to find a way to get Eclipse to actually recognize these tags/attributes because they work just fine.
The namespace http://www.w3.org/2000/svg does not seem to be recognised by your eclipse installation. Try either of:
Adding the namespace to your XML catalog (in Window > Preferences), including the schema for svg, or
Specifying the schema inline, as attributes of the svg element:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd"
(or wherever your local copy of the schema is)

ionic platform add android- Package name must look like: com.company.Name

Im getting started in developing ionic app, I followed the guide in http://ionicframework.com/docs/guide/installation.html
just in case: the command "ionic platform add ios" works and i have android sdk installed.
when typing the command "ionic platform add android" i get this error:
Adding android project...
/Users/LihaiMac/.cordova/lib/npm_cache/cordova-android/3.7.1/package/bin/node_modules/q/q.js:126
throw e;
^
Package name must look like: com.company.Name
Error: /Users/LihaiMac/.cordova/lib/npm_cache/cordova-android/3.7.1/package/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
I tried searching an answer in other related posts, but not successful..
I'll appreciate any help in solving my problem..
What mladen5 said is correct. You need to go to the config.xml of your Cordova/Phonegap project and edit the id to meet the package name expectations.
The name can be found in the ID property and is "com.mydomainhere.appnamehere" in the example config below:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.mydomainhere.appnamehere" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Awesome app</name>
<description>
The worlds most awesome app
</description>
<author email="your#email.com" href="http://www.anurlhere.com">
Author name
</author>
<content src="index.html" />
<access origin="*" />
</widget>
"Package name must look like: com.company.Name" that error is very helpful. You have package name that is invalid, probably starts with number.
Android package rules:
The first character after a period must not be a number
The first character must be a letter or underscore
Usually the app id is your company's reserved Internet domain name.
The app id must consist of letters, numbers, and underscores.
The best way to do it is when you're creating a new app. The Ionic command line interface(CLI) supports two options to do that the right way:
You can also app and package name define using command line interface(CLI) creation you project time like this bellow.
ionic start MyNewApp blank --appname MyNewApp --id com.ionicbyrequest.mynewapp
MyNewApp is my project app name.
Simple, no ? Now when you deploy to stores your id will be unique.
I had the same problem with Ionic a few weeks ago. The problem can be fixed by editing config.xml.
Find the line that starts with
The syntax inside id="" must be com.company.(company name)
ID should be without dashes, just words separated with dots: word.word.word
In your config.xml give the package name according to your project package name
Give widget id in your config.xml as com.test.testapp

filtering a category in dotcover

I understand that you can filter projects, classes and methods but is it possible to filter a category in dotcover.
I am using nuit as my unit tester.
Please help!
Thanks
Pete
Peter, you're right, you can't do that via coverage filters in dotCover, but still you can specify categories to include or exclude in nunit console runner (documentation)
It is possible from the command line. Just set /include:MyCategoryName as the first argument in TargetArguments, followed by the target dll(s).
dotcover.exe analyse coverage.config.xml
coverage.config.xml looks like this...
<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
<TargetExecutable>Thirdparty\NUnit-2.5.10.11092\bin\net-2.0\nunit-console.exe</TargetExecutable>
<TargetArguments>/include:MyCategoryName bin/release/MyAssemblyUnderTest.dll
</TargetArguments>
<TargetWorkingDir>.</TargetWorkingDir>
...
Tip: It helps if you have the location of dotcover.exe in your Environment Variables --> Path Variable.
For more info on running dotcover from the command line

ANT Javac and special characters

I have an ANT task defined like so:
<javac source="1.5" target="1.5" srcdir="${src.dir}" destdir="${classes.dir}" deprecation="on" debug="on" classpathref="classpath" fork="true" memoryMaximumSize="512m" encoding="UTF-8">
<include name="${app.directory}/**/*.java"/>
</javac>
This works fine, but when I have classes with special characters in their names it gives me the following error:
[iosession] Compiling 131 source files to /C24/PUB/io-stds/trunk/standards/GSIT/build/test/deployment/build/classes
[iosession] javac: file not found: /C24/PUB/io-stds/trunk/standards/GSIT/build/test/deployment/src/java/biz/c24/io/minos/AléaChiffréClass.java
[iosession] Usage: javac <options> <source files>
[iosession] use -help for a list of possible options
[iosession] Target compile finished
[iosession]
[iosession] Building unsuccessful 2 seconds
When I remove the "fork=true" it works, but then it ignores the "memoryMaximumSize" setting. I also tried the nested approach, but to no avail.
Any ideas?
It's perhaps not the answer you expect but my advice would be to remove all non-ascii letters from the names of methods and classes. I'm French-speaking too, and I've never seen any company, even in France and using French as its development language, accept accented letters in class names and methods. It's just not good practice, simply because it would be very hard for a non French developer, without accents on his keyboard, to use these classes and methods.
If you use a good IDE, it should allow you to refactor your code easily.
Apache did confirm that the encoding attribute only applies to the file contents and not file names. I reverted back to using fork only when needed and kept encoding="UTF-8".