French How to display French chars in ListView ?

AndyDroid2012

Member
Licensed User
Longtime User
Cela fait partie de mon dossier "dir-fr.txt"

...' Salle de lavage Carluke ~85',' Carluke Paroisse Banque 1874 ~36',' Carluke écoles paroissiales ~84',' Carluke Hôtel de ville ~28',' Carluke Ontario Titanic victime ~78',' Carlukes eau ~82',' Enfance à Carluke ~5 ',' Cinéma ~93',...

B4X:
str = File.ReadString(File.DirAssets ,"dir-fr.txt")     
     
ListView1.Clear 
      
f_split=Regex.Split(",", str)
       h = f_split.Length
    
'The Array now holds Strings with a tilde ~ delimiter between each text and ID
    For i = 0 To h-1
   f = f_split(i)
   f = f.Replace("'","")          'Remove any single quotes from the string 
   t_split=Regex.Split("~", f)    'split into two - The Topic Name and the Topic ID  
   j = t_split(1) * 1
   
   ListView1.AddSingleLine2(t_split(0), j )
   Log("textstring for " & j & " = " & t_split(0))
   
   Next



ListView1 display is

Salle de lavage Carluke
Carluke Paroisse Banque 1874
Carluke ▓coles paroissiales
Carluke H▓tel de ville
Carluke Ontario Titanic victime
Carlukes eau
Enfance ▓ Carluke
Cin▓ma

what to do to display grave/acute/accent ?

ce qu'il faut faire pour afficher accent grave aiguë ?
 
Last edited:

AndyDroid2012

Member
Licensed User
Longtime User
Wordpad.exe

Merci - le problème est résolu.
Oui utf-8, mais j'ai été en utilisant le Notepad.exe de Windows
qui semble OK, mais échoue. J'ai besoin d'utiliser Wordpad.exe de maintenir les symboles.
 
Last edited:

JJM

Active Member
Licensed User
Longtime User
Bonjour,
Le fichier sous windows est à charger comme indiquer ci-dessous:
f2.Initialize2 (File.OpenInput (fd.FilePath ,fd.ChosenName ),"ISO-8859-1")
NouvText=f2.ReadLine
f2.Close
Il sera ainsi mis au format lisible par un android.

De la même façon pour transférer un fichier android vers windows
f1.Initialize2 (File.OpenOutput (Dossier ,NomRub,True),"UTF-8")
f1.WriteLine(NouvText)
f1.Close

Bonne journée
JJM
 

Informatix

Expert
Licensed User
Longtime User
Ce n'est pas exactement ça. Android sait parfaitement lire et restituer de l'UTF-8, mais à condition qu'on lui soumette des chaînes encodées dans ce format. Si à l'origine ton fichier est encodé avec ISO-8859-1 (une norme aujourd'hui obsolète, mais encore très présente sous Windows) ou son petit cousin Windows-1252, il faut le lire en respectant cet encodage.
Le bloc-notes de Windows sait gérer le ISO-8859-1 (ANSI) et l'UTF-8. On peut choisir l'un ou l'autre lors de la sauvegarde.
 

AndyDroid2012

Member
Licensed User
Longtime User
Merci,

En fait, le problème est beaucoup plus complexe.

J'ai 195 pages web (html simples et peu des photos en chaque page)

Maintenant, je veux avoir des traductions en français, allemand, italien, polonais etc

J'utilise Google Translate et voir le texte à l'écran.
Je copier dans l'écran de vision et le coller dans un éditeur de utf-8.
Ensuite, il est enregistré à comme la page-fr.htm ou page-de.htm, page-it.htm
Ensuite je stocker toutes les pages dans dirAssets
Ensuite je appeler la langue requise dans l'application android.

Ce que je veux faire est d'automatiser cela pour toutes les pages et toutes les langues utilisant PHP ou VB sur mon bureau.
Le problème est que dans une page web Google-Traduire le code HTML pour les images et les paragraphes et retours à la ligne (<p> <img> ou <br>) disparaissent parce qu'ils controles sont dans les DOM et non dans le texte traduit.

Cette application portable est destiné à être utilisé sans wifi dans un quartier historique, donc toutes les pages doivent être stockés sur la tablette android.

Toujours un défi pour le programmeur pauvre!
(traduit ici par Google)

~ - - - - - - - - - ~


Actually the problem is much more complex.

I have 195 web pages (simple html and few photos in each page)

Now I want to have translations in French, German, Italian, Polish etc.

I use Google Translate and see the text on-screen.
I copy to clipboard and paste into a utf-8 editor.
Then it is saved to page-fr.htm or page-de.htm
Then I store all the pages in the dirAssets
Then I call the language required in the android application.

What I want to do is automate this for all the pages and all the languages using PHP or VB on my desktop.
The problem is that in a Google-Translate webpage the HTML code for pictures and paragraphs and line breaks (<img> <p> or <br>) disappear because they are in the DOM and not in the translated text.

This portable app is for use without wifi in a historical area, so all pages must be stored on the tablet.

Always a challenge for the poor programmer !
(translated here by Google)
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Google Translate peut traduire une page HTML et conserver les balises. Il ne faut pas faire un copier/coller dans la zone de texte, mais cliquer sur "Importez un document à traduire" et sélectionner sur son disque la page HTML à traduire.
 

AndyDroid2012

Member
Licensed User
Longtime User
Close but no cigar! (Gauloises ??)

Essayez cette page


http://www.carlukehistory.co.uk/b4a/page57.htm

Si vous regardez les propriétés des images que vous allez voir qu'ils sont déjà formatés pour l'ex cible android "file :///android_asset/page57-4.jpg"
parce que c'est la syntaxe correcte lorsque la page est ouverte avec WebView.

Toutefois, si vous traduire cette page avec Google Translate, vous obtiendrez accent français, les marques mais regardez maintenant la source de la page. C'est un gâchis.
Simplement copier l'écran perd les détails de l'image ainsi que <br> <p> etc

C'est ce qui m'empêche de l'automatisation du processus. 195 pages x 10 langues, c'est trop pour un programmeur pour effectuer manuellement. - Il doit y avoir une solution PHP ou VB, mais je ne peux pas penser comment le faire faire.

(traduit par Google)
~ - - - - ~


Close but no cigar !

Try this page

http://www.carlukehistory.co.uk/b4a/page57.htm

If you look at the properties of the images you will see they are already formatted for the target android e.g. "file:///android_asset/page57-4.jpg"
because that is the syntax when the page is opened with WebView.

However if you translate this page with Google Translate you will get french accent, grave marks but now look at the page source. It is a mess.
Just copying the screen loses the image details as well as <p> <br> etc.

This is what stops me from automating the process. 195 pages x 10 languages is too much for a programmer to perform manually. - There must be a PHP or VB solution but I cannot think how to do do it.
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
J'ai essayé avec cette page et la transformation a bien conservé toutes les balises. Je n'ai perdu ni l'image ni les <br>. Il faut par contre enlever le lien de Google au début de la page.
Je signale au passage que ta page est franchement mal formée (on trouve une balise <head> ouvrante sans balise fermante, <BR> devrait être <BR/>, il manque la balise ouvrante <body>, etc.).
 

Attachments

  • result.zip
    4.6 KB · Views: 218

AndyDroid2012

Member
Licensed User
Longtime User
Oui, <head> malformé à cause de tester et d'essayer.
Toutefois, la page une fois traduit, est seulement ensuite reproduit en appelant Google sur une connexion en direct sur Internet. Le paginée sauvé est un gâchis comme celui-ci


B4X:
important}.gbmt,.gbml1,.gbmlb,.gbmt:visited,.gbml1:visited,.gbmlb
:visited{color:#36c !important;text-decoration:none 
!important}.gbmt,.gbmt:visited{display:block}.gbml1,.gbmlb,.gbml1:visited
,.gbmlb:visited{display:inline-block;margin:0 
10px}.gbml1,.gbmlb,.gbml1:visited,.gbmlb:visited{*display:inline}.gbml1,.
gbml1:visited{padding:0 10px}.gbml1-hvr,.gbml1:focus{outline:none;text-
decoration:underline !important}#gbpm 
.gbml1{display:inline;margin:0;padding:0;white-
space:nowrap}.gbmlb,.gbmlb:visited{line-height:27px}.gbmlb-
hvr,.gbmlb:focus{outline:none;text-decoration:underline !#

et ne peut pas être décodé dans WebView sans connection wifi direct.

De plus, la page enregistrée est maintenant 128Kb au lieu de 2 à 4 Kb d'origine, rendant ainsi mes dirAssets environ 32x plus. Pas pratique.

La réponse, peutetre c'est en quelque sorte à coder mon pagexx-fr.htm partir de la base de données en utilisant PHP avec d'autres symboles que quelque chose <p> <img> <br> comme
~BR~ ~p~ ~IMG~ sorte que Google Translate ne fait rien pour eux,
Puis retraiter chaque pagexx-fr.htm et remplacer le ~BR~ avec <BR>
un deuxième passage.

Je ne peux pas penser à une meilleure façon.

(traduit par Google)






Yes, malformed <head> because of testing and trying.
However, the page when translated, is only then reproduced by calling Google on a live internet connection. The saved paged is a mess like this


B4X:
important}.gbmt,.gbml1,.gbmlb,.gbmt:visited,.gbml1:visited,.gbmlb
:visited{color:#36c !important;text-decoration:none 
!important}.gbmt,.gbmt:visited{display:block}.gbml1,.gbmlb,.gbml1:visited
,.gbmlb:visited{display:inline-block;margin:0 
10px}.gbml1,.gbmlb,.gbml1:visited,.gbmlb:visited{*display:inline}.gbml1,.
gbml1:visited{padding:0 10px}.gbml1-hvr,.gbml1:focus{outline:none;text-
decoration:underline !important}#gbpm 
.gbml1{display:inline;margin:0;padding:0;white-
space:nowrap}.gbmlb,.gbmlb:visited{line-height:27px}.gbmlb-
hvr,.gbmlb:focus{outline:none;text-decoration:underline !#


and cannot be decoded in WebView without a live wifi conection.

Plus, the saved page is now 128KB instead of 2 to 4 KB original, so making my dirAssets about 32x larger. Not practical.

The answer, may be to code my output pagexx-fr.htm from the database using PHP with symbols other than <br> <p> <img> something like
~BR~ ~p~ ~IMG~ so that Google Translate does nothing to them,
Then reprocess each pagexx-fr.htm and replace the ~BR~ with <BR>
as a second pass.

I cannot think of a better way.
 

AndyDroid2012

Member
Licensed User
Longtime User
Yes indeed I saw what you put in results.zip.

I am wrong, you are correct. (but read on,)

It was only while goofing around with Firefox that I discovered ViewFrameSource

I was doing a ViewPageSource

so I never saw that script or anything like it.
here is what I got


http://www.carlukehistory.co.uk/b4a/snp1.jpg
initial Google page before Translate button

http://www.carlukehistory.co.uk/b4a/snp2.jpg
page after Google has translated


but even then, the actual ViewFrameSource which I see is
french with intermingled english mouse-popover javascript
Maybe there is a setting to turn off the pop-over activity....

B4X:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html lang=fr-x-mtfrom-en><head><script>(function(){(function(){function d(a){this.t={};this.tick=function(a,c,b){b=void 0!=b?b:(new Date).getTime();this.t[a]=[b,c]};this.tick("start",null,a)}var a=new d;window.jstiming={Timer:d,load:a};if(window.performance&&window.performance.timing){var a=window.performance.timing,c=window.jstiming.load,b=a.navigationStart,a=a.responseStart;0<b&&a>=b&&(c.tick("_wtsrt",void 0,b),c.tick("wtsrt_","_wtsrt",a),c.tick("tbsd_","wtsrt_"))}try{a=null,window.chrome&&window.chrome.csi&&(a=Math.floor(window.chrome.csi().pageT),
c&&0<b&&(c.tick("_tbnd",void 0,window.chrome.csi().startE),c.tick("tbnd_","_tbnd",b))),null==a&&window.gtbExternal&&(a=window.gtbExternal.pageT()),null==a&&window.external&&(a=window.external.pageT,c&&0<b&&(c.tick("_tbnd",void 0,window.external.startE),c.tick("tbnd_","_tbnd",b))),a&&(window.jstiming.pt=a)}catch(e){}})();})()
</script><script src="http://translate.googleusercontent.com/translate/releases/twsfe_w_20130225_RC05/r/js/translate_c.js"></script><script>_infowindowVersion=1;_intlStrings._originalText = "Original English text:";_intlStrings._interfaceDirection="ltr";_intlStrings._interfaceAlign="left";_intlStrings._langpair="en|fr";_intlStrings._feedbackUrl="http://translate.google.com/translate_suggestion";_intlStrings._currentBy="Current translation on %1$s by %2$s";_intlStrings._unknown="unknown";_intlStrings._suggestTranslation="Contribute a better translation"  ;_intlStrings._submit="Contribute";_intlStrings._suggestThanks="Thank you for contributing your translation suggestion to Google Translate.";_intlStrings._reverse=false;</script><style type="text/css">.google-src-text {display: none !important} .google-src-active-text {display: block!important;color:black!important; font-size:12px!important;font-family:arial,sans-serif!important}.google-src-active-text a {font-size:12px!important}.google-src-active-text a:link {color:#00c!important;text-decoration:underline!important}.google-src-active-text a:visited {color:purple!important;text-decoration:underline!important}.google-src-active-text a:active {color:red!important;text-decoration:underline!important}</style><meta http-equiv="X-Translated-By" content="Google"><link href=http://www.carlukehistory.co.uk/b4a/page57.htm hreflang=en rel="alternate machine-translated-from"><base href=http://www.carlukehistory.co.uk/b4a/page57.htm /></head><body><iframe src="http://translate.google.co.uk/translate_un?depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.co.uk&sl=en&tl=fr&u=http://www.carlukehistory.co.uk/b4a/page57.htm&lang=en&usg=ALkJrhi2OReHEpg5ZSzr4vexVp3QT3__sw" width=0 height=0 frameborder=0 style="width:0px;height:0px;border:0px;display:none;"></iframe><table border=0 cellpadding=20px><tr><td><h2> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Early New Zealand Settlers</span> Les premiers colons New Zealand</span> </h2></td></tr></table><table cellpadding=2 border=0 width=90%><br><p> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Carlukes history is revealed in numerous stories here on our website, but equally our grandparents were seeking their fortunes in Canada, Australia and New Zealand.</span> Carlukes histoire se révèle dans de nombreuses histoires ici sur notre site, mais aussi nos grands-parents ont été chercher fortune au Canada, en Australie et en Nouvelle-Zélande.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">We will be expanding on the fortunes of William Brownlee in the Marlborough region of New Zeland in another story but first, here is the tale of the first settlers in the Rai Valley just miles from where Carluke, NZ would eventually be settled.</span> Nous allons étendre sur la fortune de William Brownlee dans la région de Marlborough en Nouvelle-Zélande dans une autre histoire, mais d'abord, voici l'histoire des premiers colons de la vallée du Rai seulement miles de là où Carluke, NZ finirait par être réglé.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">The story is taken up, with kind permission, by <a href=http://translate.googleusercontent.com/translate_c?depth=1&amp;hl=en&amp;ie=UTF8&amp;prev=_t&amp;rurl=translate.google.co.uk&amp;sl=en&amp;tl=fr&amp;u=http://www.carlukehistory.co.uk/stories/mobile.php%3Fpage%3D52%26title%3DDon_Donovan&amp;usg=ALkJrhiOQcpRgvJ1sX2fhQFKR4mUDXmJfA>Don Donovan</a> of Auckland.</span> L'histoire est repris, avec l'aimable autorisation, par <a href=http://translate.googleusercontent.com/translate_c?depth=1&amp;hl=en&amp;ie=UTF8&amp;prev=_t&amp;rurl=translate.google.co.uk&amp;sl=en&amp;tl=fr&amp;u=http://www.carlukehistory.co.uk/stories/mobile.php%3Fpage%3D52%26title%3DDon_Donovan&amp;usg=ALkJrhiOQcpRgvJ1sX2fhQFKR4mUDXmJfA>Don Donovan</a> d'Auckland.</span> </p><p></p><br><table cellpadding=2 border=0 width=90%><br><h4> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">The Rai Valley Cottage, Carluke</span> Le Cottage Rai Valley, Carluke</span> </h4><p> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">This sturdy pioneers' cottage in the Rai Valley, between Blenheim and Nelson, is in remarkably good condition not only because it was well built in the first place but also because it has been carefully looked after by volunteers and the Historic Places Trust in recent years.</span> Ce chalet pionniers robustes »dans la vallée de Rai, entre Blenheim et Nelson, est dans un état remarquable non seulement parce qu'elle était bien bâtie, en premier lieu, mais aussi parce qu'elle a été soigneusement entretenu par des bénévoles et de la Fiducie endroits historiques ces dernières années .</span> <br /> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">It was built by Charles and Arthur Turner, the first settlers in the valley, in 1881, and was occupied by Charles and his wife Matilda and their children for the next twenty-five years.</span> Il a été construit par Charles et Arthur Turner, les premiers colons de la vallée, en 1881, et a été occupée par Charles et son épouse Mathilde et leurs enfants pour les prochaines 25 années.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">They lived remotely for the first four of those years until the coach road from Nelson was formed, and one can only imagine the hard times they must have endured, the constant danger from injury, the lack of medical help, the absence of easy communication.</span> Ils ont vécu à distance pour les quatre premiers de ces années jusqu'à ce que la route des diligences de Nelson a été formé, et on ne peut qu'imaginer les moments difficiles qu'ils ont dû enduré, le danger constant d'une blessure, le manque d'aide médicale, l'absence de communication facile.</span> </p><br><table cellpadding=2 border=0 width=90%><img src=file:///android_asset/page57-4.jpg><table cellpadding=2 border=0 width=90%><br><p> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Apart from a corrugated iron chimney, the cottage was entirely made of local materials: split Totara slabs for the walls and roof shingles, and round stones from the local riverbed to support the chimney.</span> En dehors d'une cheminée en tôle ondulée, le chalet a été entièrement réalisée en matériaux locaux: dalles Totara partiels pour les murs et les bardeaux de toiture, et des pierres rondes du lit de la rivière locale pour supporter la cheminée.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Charles would spend weekdays working as a bushman in Pelorus Valley – a fair distance away even by horse - while Matilda and the children worked at undergrowth clearing around the house.</span> Charles passait semaine de travail comme un bushman dans Pelorus Valley - une bonne distance même à cheval - pendant que Matilda et les enfants ont travaillé au débroussaillage autour de la maison.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Eventually they cleared enough to fell the bush</span> Finalement, ils ont dégagé assez pour abattre la brousse</span> <br /> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">and establish a cattle farm and so succeeded through the diligence and faith that marked those courageous pioneer families.</span> et mettre en place une ferme d'élevage et ainsi réussi grâce à la diligence et de la foi qui a marqué ces familles de pionniers courageux.</span> </p><p> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">They were also well known for their hospitality and welcomed passers by.</span> Ils étaient également bien connus pour leur hospitalité et les passants accueillis par.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Indeed a diary note by one of the children recorded a hardly believable 500 visitors in 1894 alone!</span> En effet, une note de l'agenda de l'un des enfants a enregistré de 500 à peine croyable visiteurs en 1894 seulement!</span> <br /> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Various additions were made to the cottage as time passed: a separate cookhouse and bakery, dairy, milking shed and a 'bloke's shed' to where Charles could escape to play his violin.</span> Divers ajouts ont été apportés à la maison avec le temps: une cuisine de chantier séparée et d'une boulangerie, produits laitiers, poste de traite et un «gars de cabanon» à l'endroit où Charles ne pouvait échapper à jouer du violon.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">(Which might also have been a relief for the family!)</span> (Qui pourrait également avoir été un soulagement pour toute la famille!)</span> <br /> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">A settlement of about 100 developed nearby, with a school and sawmill founded by William Brownlee.</span> Un règlement d'environ 100 développé à proximité, avec une école et une scierie fondée par William Brownlee.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">It was named Carluke after Brownlee's birthplace in Scotland.</span> Il a été nommé après Carluke berceau Brownlee en Ecosse.</span> </p><h5> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><a href=http://translate.googleusercontent.com/translate_c?depth=1&amp;hl=en&amp;ie=UTF8&amp;prev=_t&amp;rurl=translate.google.co.uk&amp;sl=en&amp;tl=fr&amp;u=http://www.carlukehistory.co.uk/stories/mobile.php%3Fpage%3D58&amp;usg=ALkJrhgKF8Mbi6Z5vqbrTwjAP_c7B_zrkw>continued</a></span> <a href=http://translate.googleusercontent.com/translate_c?depth=1&amp;hl=en&amp;ie=UTF8&amp;prev=_t&amp;rurl=translate.google.co.uk&amp;sl=en&amp;tl=fr&amp;u=http://www.carlukehistory.co.uk/stories/mobile.php%3Fpage%3D58&amp;usg=ALkJrhgKF8Mbi6Z5vqbrTwjAP_c7B_zrkw>continué</a></span> </h5><br><noscript> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Javascript is disabled, Use the Sitemap to open documents.</span> Javascript est désactivé, utilisez les Plan d'ouvrir des documents.</span> </noscript></td></tr></table><br> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">

<b>CPHS Story Teller</b> .</span> <b>Story Teller CPHS.</b></span>
 <span onmouseover="_tipon(this)" onmouseout="_tipoff()">

<span class="google-src-text" style="direction: ltr; text-align: left">

Stories and Images ©2013 Carluke Parish History Society, All rights reserved.</span>

 Histoires et Images © 2013 Société Carluke Histoire Paroisse, Tous droits réservés.</span> 

<br><br><br><br><br><br><br><br><br></body><script>_addload(function(){_setupIW();_csi('en','fr','http://www.carlukehistory.co.uk/b4a/page57.htm');});</script></html>

Thank you for your time.
I think I will plod on and see how obfuscation ?? of the HTML control characters works
and then resubstitute the correct control characters.

Remember I want as little manual intervention as possible if I am to convert 195 pages x 12 languages.
 

AndyDroid2012

Member
Licensed User
Longtime User
I have done a quick test and come up with a set of codes which PHP will use.
Our 195+ stories are all in a MySql database and so PHP can pull 10 stories at a time and append them to a file.

The file will then have the HTML codes obfuscated and then the entire page is translated by GoogleTranslate as a paste in.
The paste out is then dropped into PHP for re-substitution of the correct HTML and as it finds "ndpage1" it will
save the ten translated pages individually. This way I only need to paste 20 times for 200 pages.
If I can do 40 pages concatenated (I dont know the max document size) then even better.
This needs to be done 12 times for twelve languages.

I apologise for any wasted time but I will place the PHP code here eventually, for anyone else to use.

CODES

brk1 = <BR>
stpara1 = <p>
ndpara1 = </p>
ndpage1 = </body></html>
stimg1 = <img
stfile1 = file:///

and so on


B4X:
stpara1
Scottish Country Dancing is another form of recreative pleasure which has grown immensely in post-war years and a number of enthusiastic classes have been formed. It will therefore be seen that local entertainment has a fairly wide range and gives ample opportunity for those so inclined to use the talent with which they have been gifted.brk2M.L., Class 3B.
ndpara1
stpara1
&nbsp;ndpara1brk1noscr1Javascript is disabled, Use the Sitemap to open documents.</noscript></td></tr></table> brk1 <b>CPHS Story Teller</b>. Stories and Images &copy;2013 Carluke Parish History Society, All rights reserved.
brk1 brk1 brk1 brk1 brk1 brk1 brk1 brk1 brk1 ndpage1
 
Top