I’m in error of Apostrophe not preceded by

Asked

Viewed 79 times

1

I’m trying to internationalize my app to the English language but I end up getting this error

Error:(10) Apostrophe not preceded by (in Please note, if you’re on a device with android 6.0 above, you need the Permissions that the app request the following screens to the Proper functioning)

this is my string-en.xml

<resources>
<string name="app_name">Lanterna Flash</string>
<string name="texto">Texto tester</string>

<string name="title_activity_fullscreen">FullscreenActivity</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">DUMMY\nCONTENT</string>

<string name="tela1">Welcomes!</string>


<string name="tela2">Take advantage of our application, it is the flashlight for devices that have flash or the screen flash.</string>

<string name="tela3">Please note, if you're on a device with android 6.0 above, you need the permissions that the app request the following screens to the proper functioning</string>


<string name="avisoToast">Seu dispositivo não tem flash!</string>

and this is my.xml string, which is in the values folder:

<resources>
<string name="app_name">Lanterna Flash</string>

<string name="texto">Texto tester</string>

    <string name="title_activity_fullscreen">FullscreenActivity</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">DUMMY\nCONTENT</string>

<string name="tela1">Bem Vindo!</string>


<string name="tela2">Aproveite o nosso aplicativo, ele consiste na lanterna para aparelhos que tenham flash ou para o flash de tela.</string>

<string name="tela3">Atenção se você estiver em um aparelho com android 6.0 acima, será necessário das as permissões que o app solicitar nas telas a seguir para o devido funcionamento</string>


<string name="avisoToast">Seu dispositivo não tem flash!</string>

Don’t linger for the translation just by doing a test, until then when I add there in string-en to screen 1 it goes further when I add screen 2 (the texts in English it gives that error) help me who can I thank...

  • 1

    Alter if you're for if you\'re

  • The error message means that you have used in some part of the text an apostrophe ( ' ) without the proper escape sequence ( ' )

  • Our many thanks ramaral and Haroldo_ok, I was breaking my head with this, so simple thing, and I couldn’t find any example on the internet that would help me, but thanks :)

  • @ramaral you could post a reply?

1 answer

3


In Android apostrophe(') is one of the characters that when used in Resources of the string type, must be inserted into a escape sequence or, alternatively, put the whole string in quotes(").

In your case the problem is in the part you're of string "tela3":

<string name="tela3">Please note, if you're on a device with android 6.0 above, you need the permissions that the app request the following screens to the proper functioning</string>

Put the character \ before the apostrophe to create the escape sequence:

<string name="tela3">Please note, if you\'re on a device with android 6.0 above, you need the permissions that the app request the following screens to the proper functioning</string>

or place the entire string between quotation marks:

<string name="tela3">"Please note, if you're on a device with android 6.0 above, you need the permissions that the app request the following screens to the proper functioning"</string>

Another character that needs the same treatment is the quotation marks which, in this case, can only be solved by using the exhaust sequence.

<string name="exemplo">Isto é um "mau" exemplo</string>
<string name="exemplo">Isto é um \"bom\" exemplo</string>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.