![]() (This was copied from the Wesnoth translation forum, a thread and an brilliant idea from User:Viliam ) You can leave off the "-c | sort -nr" part if you don't care about the number of occurrences. (Looks for id= keys in and tags and extracts the value then sorts them by number of occurrences.) It contains *.cfg files for each campaign-scenario.Ĭd /data/campaigns/Northern_Rebirth/scenarios sed -n '/\/,/\/ba /\/,/\/ba b :a s/^ *id *= *"\?\(*\)"\?/\1/p' *.cfg | sort | uniq -c | sort -nr > ~/NRcharacterlist.txt (no re-saving in poedit necessary)īe aware, that you should be in the right directory. : id= : : one-line version: sed -n 's/#\. A sed script to extract dialog and story parts in the form: \/g" > english.txt Extracting a script with original and translated strings >cat de.po | grep -v "msgstr \"" | grep -v "#: data" | sed "s/\: speaker//g" | sed "s/#. It still contains some target language parts. This one is even more preliminary than the one before. I load this text file into a editor to print it in two columns with the name of the "speaker" intended (like in script book).įor proof-reading of a campaign it might be much easier to print it out in a more "scriptlike" format (: ) (english only), e.g. (derived from the SED-command below- thanks to Soliton) \/g" > target-language-script.txtĪn even nicer extraction method without saving via poedit is the following : Thanks to the programmer(s) that included the "speaker" in the comments of the po-files (Ivanovic?)! Those are definitely helpful and make this approach possible. to read it in a bus, a train or in a car. (Checks whether there is a trailing space and the next line is empty.)įor proof-reading of a campaign it might be much easier to print it out in a more "scriptlike" format (: ) (target language only), e.g. Your "diff" will only contain your changes and will look much nicer - your language maintainer will like you even more :).Īt the end of each translated "string", spaces should be avoided. This may be done by executing the following:ĭiff -u file.po > file.po.diff Especially, it must be undone prior to "diff" the new version against the old one. Or using msgcat (part of GNU gettext), save the file with the -no-wrap switch,Īnyhow, those changes introduced by poEdit should be undone prior sending the new po-File to your language maintainer. Without saving the file with poEdit, the number of text-lines would be undefined. As result, a normal entry consists of 4 lines, where one line contains the "characters text" and a prior line the "characters name". The reason is, that then the texts are saved in separated lines without interfering /n's. Prior to use the shell scripts, the po-File needs to be opened and saved with poEdit. 9 Style scripts following the typographic style guide. ![]() 6 Extracting a script with original and translated strings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |