Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Replace multiple whole words in html file from speadsheet style data list tool?

Author
Message
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 22nd Apr 2013 02:03
I have web page calculator tools that will be translated into 40 languages. I want to give translators something that enables easy translation of my list of words. A spreadsheet type list would enable clarity, my words on the left, they fill in the translations on the right, then I want to be able to easily take the list on the left and search a web page for those words, and then if it finds the 'whole word' or text and swap it for the word or text on the right, and do this for everything on the list as a batch process.

For translations of the code in software "in this case a webpages code" a tool that allows batch word replace is a must. As is a way to set the translations out, spreadsheet type columns seem the clearest most logical choice, and offer a way to allow easy translation from the translation service and then onto the conversion of the code.

Are there any tools that allow this? multiple web pages across multiple languages, we are talking hundreds of pages and thousands of words. An efficient tool and pipeline is a must.


The Wilderbeast
19
Years of Service
User Offline
Joined: 14th Nov 2005
Location: UK
Posted: 22nd Apr 2013 12:05
Drop me a mail sometime this week and I will knock up a Python script for you if I have time. You can make your spreadsheet up and then export as CSV which makes both editing and parsing a lot simpler.

RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 22nd Apr 2013 14:28 Edited at: 22nd Apr 2013 14:29
So... you want to take each word by itself and translate it? Language doesn't work that way... just look at the junk Google Translate and similar services produce. (Though nowadays Google Translate seems to have gotten a bit better than I remember because it relies on actual human translations or some fancy magic tricks )
With translations the context is very important, as different words can mean different things depending on what you're talking about... synonyms and homonyms and all that stuff. Also, idioms and whatnot. Okay I'm partly just trying to use fancy words here, but it's still true.

I'm just saying that because it sounds like that is your plan - if it's not then just ignore this post.
Actually, rereading your post, you said it's just for web calculator tools or something? But even there the translator could easily pick an unfitting translation if they don't know the context. Just sayin'. :3

The tool or script itself is probably easily created, just reading a list of word-pairs and replace one with the other whereever it occurs in the file... just make sure you only replace actual words, you don't want to turn 'word' into 'woderd' for example just by replacing 'or' with 'oder' (would be german translation in this case I guess )
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 24th Apr 2013 00:56
everything that redflames said -
Quote: " I want to give translators something that enables easy translation of my list of words"



fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 11th May 2013 21:12 Edited at: 11th May 2013 21:16
I simplified my requirments,
2 lists, find and replace, swap instances or 'whole words' on the left for words on the right. Must work on a Mac.

Ive had to hit one of those micro job boards for this, Ill make it free for others to download and use, as quite frankly something like this should be standard as its a basic need, swapping one word at a time, come on, batch swapping must be a common need.


Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th May 2013 22:02 Edited at: 11th May 2013 22:07
a better way to do it, seems to me, is that the 'base' files don't use a specific language hard coded in, but variables which can select content by language.

say you've got a button, instead of hard coding the label which then needs to have multiple copies, each translated and hard coded into a different language, pull the label from an array of languages like btnLabels[btn1].english, btnLables[btn1].german etc.

then you would have a single flexible, extensible page, pulling content dynamically instead of 40 copies of the same page in different languages. making changes/bug fixes to all those copies would be a nightmare.

here is some info on supporting multiple languages specifically in android, but the basic concepts can be applied pretty much anywhere:

http://developer.android.com/training/basics/supporting-devices/languages.html

Shazam!
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 11th May 2013 23:03 Edited at: 12th May 2013 00:50
This is a web page made into a native app with phonegap, so I dont think that link will do the job, also thats just for android, this app goes onto 5 platforms.


Using variables for translations, its easier just to put them in for now, though I would save make 40 different versions of the web pages, Ill try this for an update in the future, for now Ill stick to putting them into the page.


Login to post a reply

Server time is: 2025-05-15 00:49:40
Your offset time is: 2025-05-15 00:49:40