I'm wrong with Apostrophe not preceded by

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 following screenshots apply 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 string.xml 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>

Do not just linguine for translation by doing a test, until then when I add there in the string-en the screen 1 it goes more when I add the screen 2 (the texts in English he gives this error) help me who can I thank ...

    
asked by anonymous 07.11.2016 / 15:43

1 answer

3

In Android, apostrophe ( ' ) is one of the characters that when used in resources of the type string , must be inserted in a escape sequence or, alternatively, put the entire string in quotation marks ( " ).

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

<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 enclose the entire string in 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 using the escape sequence.

<string name="exemplo">Isto é um "mau" exemplo</string>
<string name="exemplo">Isto é um \"bom\" exemplo</string>
    
08.11.2016 / 20:39