Ok, I understood why there are a lot of '.html-' href.
This occurs because if you have these strings to translate:
'aaa': 'www'
'aaa#bbb': 'www#zzz'
If you execute the replacing of the first one, you'll have every aaa translated:
href="www"
href="www#bbb"
So when you looking for second one you'll never match.
The solution at this problem is simple, in fix-urls.sh you could replace all urls in this way:
OLD ONES:
s#url1#url2#g
NEW ONES:
s#"url1"#"urls"#g
This make sure that when you replace some urls like:
href="aaa"
You'll translate just it, and an href="aaa#bbb" will remains the same.
There is a more simple solution in fix-urls.py, just remplace this line:
body = body.replace(""url, urls[url] % {'lang' : language})
in this one:
body = body.replace('\"%s\"' % url , '\"%s\"' % (urls[url] % {'lang' : language}))
So, after a rebuild I saw several untraslated urls:
add-applications/C/installing.html: <p>For more information about using the <span class="application"><strong>Ubuntu Software Center</strong></span>, consult the <a class="ulink" href="ghelp:software-center" target="_top">Ubuntu Software Center Manual</a>.</p>
add-applications/C/removing.html: <p>For more information about using the <span class="application"><strong>Ubuntu Software Center</strong></span>, consult the <a class="ulink" href="ghelp:software-center" target="_top">Ubuntu Software Center Manual</a>.</p>
desktop-effects/C/compiz-default-plugins.html: <p>The Viewport Switcher is used to switch <a class="ulink" href="ghelp:user-guide#overview-workspaces" target="_top">workspaces</a>
hardware/C/disks.html: <a class="ulink" href="ghelp:add-applications#removing" target="_top">
internet/C/email.html: <p>The <span class="application"><strong>Evolution</strong></span> groupware suite is the default email client, and can handle all of your <a class="ulink" href="http://library.gnome.org/users/evolution/stable/usage-mail.html" target="_top">email</a>, <a class="ulink" href="ghelp:evolution#usage-contact" target="_top">contact lists</a>, <a class="ulink" href="ghelp:evolution#usage-calendar-todo" target="_top">tasks</a> and <a class="ulink" href="http://library.gnome.org/users/evolution/stable/usage-calendar.html" target="_top">calendar</a> needs. It also integrates with the <a class="ulink" href="http://library.gnome.org/users/clock/stable/" target="_top">panel clock</a>, giving you one-click access to your task list.</p>
internet/C/modem-connect.html: If you have no working Internet connection, then you will need to obtain this package and install it, see <a class="ulink" href="ghelp:add-applications#installing-deb" target="_top">Downloading and installing a .deb package</a> for more information.</p>
keeping-safe/C/backup-files.html: <p>By default, restored files and directories are owned by root. This is because Simple Backup Suite runs with root priveleges. You need to <a class="ulink" href="ghelp:user-guide#nautilus-permissions" target="_top">change these file or folder permissions</a> using <span class="application"><strong>File Browser</strong></span>.
musicvideophotos/C/photos-sharing.html: photo sharing service</a> or a <a class="ulink" href="ghelp:f-spot#website-gallery-folder" target="_top">web gallery</a>.
musicvideophotos/C/music-listen.html: <p>See the <a class="ulink" href="ghelp:user-guide#nautilus-preferences" target="_top">
musicvideophotos/C/video-playback.html: <a class="ulink" href="ghelp:add-applications#restricted-software" target="_top">Restricted
musicvideophotos/C/video-playback.html: some <a class="ulink" href="ghelp:add-applications#restricted-software" target="_top">legal
musicvideophotos/C/video-dvd.html: Read about <a class="ulink" href="ghelp:add-applications#restricted-software" target="_top">
newtoubuntu/C/connecting.html: <p>For further reading or troubleshooting see <a class="ulink" href="ghelp:internet" target="_top">Internet and Networks</a>.</p>
newtoubuntu/C/music-video.html: <p>Music and video files require special software to play them, called <span class="emphasis"><em>codecs</em></span>. Some codecs (for example those required to play MP3s) are not included by default in Ubuntu because they are <a class="ulink" href="ghelp:add-applications#restricted-software" target="_top">proprietary</a>. You will be prompted to add support for the necessary codec if you try to play a music or video file which is not supported.</p>
newtoubuntu/C/music-video.html: <p>To add support for all frequently used music and video files, <a class="ulink" href="apt:ubuntu-restricted-extras" target="_top">install the ubuntu-restricted-extras package</a>. This will also add support for <a class="ulink" href="ghelp:musicvideophotos#video-playback-flash" target="_top">websites which use Flash video</a>.</p>
newtoubuntu/C/music-video.html: <p>For more instructions about playing music and videos, see <a class="ulink" href="ghelp:musicvideophotos" target="_top">Music, Video and Photos</a>.</p>
newtoubuntu/C/add-applications.html: <p>For more instructions about using <span class="application"><strong>Software Center</strong></span>, see <a class="ulink" href="ghelp:software-center" target="_top">the Software Center help</a>. Further reading on how applications are managed in Ubuntu can be found in <a class="ulink" href="../../add-applications/C/index.html" target="_top">Adding, Removing and Updating Applications</a>.</p>
switching/go01.html: To setup a fax modem, see <a class="ulink" href="ghelp:printing#faxing" target="_top">Faxing</a>.
Ok, I understood why there are a lot of '.html-' href.
This occurs because if you have these strings to translate:
'aaa': 'www'
'aaa#bbb': 'www#zzz'
If you execute the replacing of the first one, you'll have every aaa translated:
href="www"
href="www#bbb"
So when you looking for second one you'll never match.
The solution at this problem is simple, in fix-urls.sh you could replace all urls in this way:
OLD ONES:
s#url1#url2#g
NEW ONES:
s#"url1"#"urls"#g
This make sure that when you replace some urls like:
href="aaa"
You'll translate just it, and an href="aaa#bbb" will remains the same.
There is a more simple solution in fix-urls.py, just remplace this line: '\"%s\" ' % url , '\"%s\"' % (urls[url] % {'lang' : language}))
body = body.replace(""url, urls[url] % {'lang' : language})
in this one:
body = body.replace(
So, after a rebuild I saw several untraslated urls:
add-application s/C/installing. html: <p>For more information about using the <span class=" application" ><strong> Ubuntu Software Center< /strong> </span> , consult the <a class="ulink" href="ghelp: software- center" target= "_top"> Ubuntu Software Center Manual</a>.</p> s/C/removing. html: <p>For more information about using the <span class=" application" ><strong> Ubuntu Software Center< /strong> </span> , consult the <a class="ulink" href="ghelp: software- center" target= "_top"> Ubuntu Software Center Manual</a>.</p> effects/ C/compiz- default- plugins. html: <p>The Viewport Switcher is used to switch <a class="ulink" href="ghelp: user-guide# overview- workspaces" target= "_top"> workspaces< /a> C/disks. html: <a class="ulink" href="ghelp: add-application s#removing" target="_top"> C/email. html: <p>The <span class=" application" ><strong> Evolution< /strong> </span> groupware suite is the default email client, and can handle all of your <a class="ulink" href="http:// library. gnome.org/ users/evolution /stable/ usage-mail. html" target= "_top"> email</ a>, <a class="ulink" href="ghelp: evolution# usage-contact" target= "_top"> contact lists</a>, <a class="ulink" href="ghelp: evolution# usage-calendar- todo" target= "_top"> tasks</ a> and <a class="ulink" href="http:// library. gnome.org/ users/evolution /stable/ usage-calendar. html" target= "_top"> calendar< /a> needs. It also integrates with the <a class="ulink" href="http:// library. gnome.org/ users/clock/ stable/" target="_top">panel clock</a>, giving you one-click access to your task list.</p> C/modem- connect. html: If you have no working Internet connection, then you will need to obtain this package and install it, see <a class="ulink" href="ghelp: add-application s#installing- deb" target= "_top"> Downloading and installing a .deb package</a> for more information.</p> safe/C/ backup- files.html: <p>By default, restored files and directories are owned by root. This is because Simple Backup Suite runs with root priveleges. You need to <a class="ulink" href="ghelp: user-guide# nautilus- permissions" target= "_top"> change these file or folder permissions</a> using <span class=" application" ><strong> File Browser< /strong> </span> . s/C/photos- sharing. html: photo sharing service</a> or a <a class="ulink" href="ghelp: f-spot# website- gallery- folder" target="_top">web gallery</a>. s/C/music- listen. html: <p>See the <a class="ulink" href="ghelp: user-guide# nautilus- preferences" target="_top"> s/C/video- playback. html: <a class="ulink" href="ghelp: add-application s#restricted- software" target= "_top"> Restricted s/C/video- playback. html: some <a class="ulink" href="ghelp: add-application s#restricted- software" target="_top">legal s/C/video- dvd.html: Read about <a class="ulink" href="ghelp: add-application s#restricted- software" target="_top"> C/connecting. html: <p>For further reading or troubleshooting see <a class="ulink" href="ghelp: internet" target= "_top"> Internet and Networks</a>.</p> C/music- video.html: <p>Music and video files require special software to play them, called <span class=" emphasis" ><em>codecs< /em></span> . Some codecs (for example those required to play MP3s) are not included by default in Ubuntu because they are <a class="ulink" href="ghelp: add-application s#restricted- software" target= "_top"> proprietary< /a>. You will be prompted to add support for the necessary codec if you try to play a music or video file which is not supported.</p> C/music- video.html: <p>To add support for all frequently used music and video files, <a class="ulink" href="apt:ubuntu- restricted- extras" target= "_top"> install the ubuntu- restricted- extras package</a>. This will also add support for <a class="ulink" href="ghelp: musicvideophoto s#video- playback- flash" target= "_top"> websites which use Flash video</a>.</p> C/music- video.html: <p>For more instructions about playing music and videos, see <a class="ulink" href="ghelp: musicvideophoto s" target= "_top"> Music, Video and Photos</a>.</p> C/add-applicati ons.html: <p>For more instructions about using <span class=" application" ><strong> Software Center< /strong> </span> , see <a class="ulink" href="ghelp: software- center" target="_top">the Software Center help</a>. Further reading on how applications are managed in Ubuntu can be found in <a class="ulink" href=". ./../add- applications/ C/index. html" target= "_top"> Adding, Removing and Updating Applications< /a>.</p> go01.html: To setup a fax modem, see <a class="ulink" href="ghelp: printing# faxing" target= "_top"> Faxing< /a>.
add-application
desktop-
hardware/
internet/
internet/
keeping-
musicvideophoto
musicvideophoto
musicvideophoto
musicvideophoto
musicvideophoto
newtoubuntu/
newtoubuntu/
newtoubuntu/
newtoubuntu/
newtoubuntu/
switching/