Closed decamps-enmanuel closed 1 year ago
Could you please show your code?
Could you please show your code?
const contentText = "La excursión en kayak es nuestra actividad más popular; una aventura relajante donde puedes recorrer 5km por un río de aguas color azul turquesa, hermosos bancos de arena, árboles centenarios, y un paisaje autentico, agradable, y romántica para las parejas, divertida para amigos y familiares.
Esta excusión es guiada por jóvenes de la comunidad, capacitados y con experiencia para realizar deportes acuáticos.
Durante el recorrido puedes disfrutar de un refrigerio a base de productos locales, paradas para disfrutar dentro y fuera del agua, almuerzo típico en casa de familia, transporte interno, y los equipos necesarios para la actividad."
const onTranslate = async () => {
console.log("contentText", contentText);
const result = await translate("es", "en", `${contentText}`, {
type: "google",
timeout: 10000,
});
console.log("translation result is", result);
};
The last console log only returns this: "The kayak excursion is our most popular activity;"
Is it not work?
const onTranslate = async () => {
const result = await translate("es", "en", `${contentText.replace(/;/gi, "");}`, {
type: "google",
timeout: 10000,
});
console.log("translation result is", result);
};
If I replace that the content will lose the ";". The semi colon is not the only thing that's stopping the translator to stop.
I resolved issue by use encodeURI
. Following are the command you can test new code.
package.lock.json
& node_modules
react-native-translator: "1.1.3"
from package.json
npm install
npm i --save https://github.com/KoreanThinker/react-native-translator.git#url-encoding
@decamps-enmanuel Do you resolve?
@decamps-enmanuel Are you resolved?
It now translates correctly but the output returns without spaces after periods.
Example:
Input > This is a test. Hello! How are you? Output > Esto es un ejemplo.Hola!Como estas?
im also facing this issue.. any updates?
im also facing this issue.. any updates?
I'm so busy... I think this is easy to resolve. Can you pull some request?
By the refer https://github.com/KoreanThinker/react-native-translator/pull/8
Hello, great lib. I'm stuck in an specific point. I'm trying to translate some text and the hook only returns the text until a special character is found.
Example: Input string: La excursión en kayak es nuestra actividad más popular; una aventura relajante donde puedes recorrer 5km por un río de aguas color azul turquesa, hermosos bancos de arena, árboles centenarios, y un paisaje autentico, agradable, y romántica para las parejas, divertida para amigos y familiares.
Output : The kayak excursion is our most popular activity;
As you can see it stops right at the first ";".
Removing the special characters allows the hook to translate it all but it's dynamic text so I can't really start replacing special characters.
Any ideas?