diff options
-rwxr-xr-x | l10n_script.sh | 28 | ||||
-rw-r--r-- | source/conf.py | 6 | ||||
-rw-r--r-- | source/content/index.rst | 101 | ||||
-rw-r--r-- | source/index.rst | 101 | ||||
-rw-r--r-- | test.html | 453 |
5 files changed, 120 insertions, 569 deletions
diff --git a/l10n_script.sh b/l10n_script.sh index 85c0b19..aedaedf 100755 --- a/l10n_script.sh +++ b/l10n_script.sh @@ -17,6 +17,12 @@ # usage: l10n_script.sh <language> +LANGUAGE="$1" +SOURCE_DIR="source" +TRANSLATED_PO_PATH="translated_po/$LANGUAGE" +TRANSLATED_MO_PATH="source/translated/$LANGUAGE" + +# check whether a language is set as an argument if [ "$#" == "0" ]; then echo "No language provided" echo "Usage: ./l10n_script.sh <language>" @@ -28,34 +34,35 @@ if [ ! -d "help" ]; then mkdir "help" fi -LANGUAGE="$1" -TRANSLATED_PO_PATH="translated_po/$LANGUAGE" -TRANSLATED_MO_PATH="source/translated/$LANGUAGE" - # create mo files if [ ! -d $TRANSLATED_PO_PATH ]; then echo "No PO files found for the language" exit 1 fi + +# check and create directories if [ ! -d $TRANSLATED_MO_PATH ]; then mkdir $TRANSLATED_MO_PATH fi if [ ! -d $TRANSLATED_MO_PATH/LC_MESSAGES ]; then mkdir $TRANSLATED_MO_PATH/LC_MESSAGES fi +if [ ! -d $TRANSLATED_MO_PATH/LC_MESSAGES/content ]; then + mkdir $TRANSLATED_MO_PATH/LC_MESSAGES/content +fi for file in $TRANSLATED_PO_PATH/*.po do # remove the prefix numbers and build the mo files mo_file=$(basename $(echo "$file" | sed 's/\.po/\.mo/') | sed 's/^[0-9]*_//') - msgfmt "$file" -o $TRANSLATED_MO_PATH/LC_MESSAGES/"$mo_file" + msgfmt "$file" -o $TRANSLATED_MO_PATH/LC_MESSAGES/content/"$mo_file" done # build html if [ ! -d help/$LANGUAGE ]; then mkdir help/$LANGUAGE fi -sphinx-build -b html -Dlanguage=$LANGUAGE source help/$LANGUAGE +sphinx-build -b html -Dlanguage=$LANGUAGE $SOURCE_DIR help/$LANGUAGE # move images and static content and remove sources rm -rf help/_images help/_static @@ -63,9 +70,6 @@ mv help/$LANGUAGE/_images help/ mv help/$LANGUAGE/_static help/ rm -r help/$LANGUAGE/_sources -# replacing staic content links -for file in help/$LANGUAGE/*.html -do - echo $file - sed -i 's/_images/..\/_images/g;s/_static/..\/_static/g' "$file" -done +# move html files to the root on the language directory +mv help/$LANGUAGE/content/*.html help/$LANGUAGE/ +rmdir help/$LANGUAGE/content diff --git a/source/conf.py b/source/conf.py index 4e7518c..812e664 100644 --- a/source/conf.py +++ b/source/conf.py @@ -37,7 +37,7 @@ source_suffix = '.rst' #source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = 'content/index' # General information about the project. project = u'Sugar' @@ -54,8 +54,8 @@ release = '0.94' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None -locale_dirs=["translated/"] +locale_dirs=['translated/'] +gettext_compact=False # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/source/content/index.rst b/source/content/index.rst new file mode 100644 index 0000000..50761fb --- /dev/null +++ b/source/content/index.rst @@ -0,0 +1,101 @@ +.. Sugar documentation master file, created by + sphinx-quickstart on Thu Apr 18 12:17:36 2013. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Sugar's documentation! +================================= + +Contents: + + +Introduction + +.. toctree:: + :maxdepth: 1 + + about.rst + about_olpc.rst + about_sugar.rst + how_to_volunteer.rst + credits_copyright.rst + +Hardware + +.. toctree:: + :maxdepth: 1 + + getting_started.rst + opening_the_xo.rst + starting_the_xo.rst + ports.rst + keyboard.rst + maintaining.rst + battery.rst + repair.rst + hardware_evolution.rst + +Software + +.. toctree:: + :maxdepth: 1 + + sugar_ui.rst + home_view.rst + neighborhood_view.rst + group_view.rst + frame.rst + journal.rst + my_settings.rst + gnome.rst + schoolserver.rst + +Activities + +.. toctree:: + :maxdepth: 1 + + what_is_an_activity.rst + launching_activities.rst + switching_activities.rst + collaborating.rst + exiting_activities.rst + browse.rst + calculate.rst + chat.rst + fototoon.rst + measure.rst + memorize.rst + paint.rst + pippy.rst + portfolio.rst + read.rst + record.rst + terminal.rst + tamtammini.rst + turtleart.rst + write.rst + +Network + +.. toctree:: + :maxdepth: 1 + + give_me_the_internet.rst + getting_connected.rst + troubleshooting_connectivity.rst + +Support + +.. toctree:: + :maxdepth: 1 + + upgrade_all.rst + getting_support.rst + +Appendices + +.. toctree:: + :maxdepth: 1 + + glossary.rst diff --git a/source/index.rst b/source/index.rst deleted file mode 100644 index e9d5e8a..0000000 --- a/source/index.rst +++ /dev/null @@ -1,101 +0,0 @@ -.. Sugar documentation master file, created by - sphinx-quickstart on Thu Apr 18 12:17:36 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Sugar's documentation! -================================= - -Contents: - - -Introduction - -.. toctree:: - :maxdepth: 1 - - content/about.rst - content/about_olpc.rst - content/about_sugar.rst - content/how_to_volunteer.rst - content/credits_copyright.rst - -Hardware - -.. toctree:: - :maxdepth: 1 - - content/getting_started.rst - content/opening_the_xo.rst - content/starting_the_xo.rst - content/ports.rst - content/keyboard.rst - content/maintaining.rst - content/battery.rst - content/repair.rst - content/hardware_evolution.rst - -Software - -.. toctree:: - :maxdepth: 1 - - content/sugar_ui.rst - content/home_view.rst - content/neighborhood_view.rst - content/group_view.rst - content/frame.rst - content/journal.rst - content/my_settings.rst - content/gnome.rst - content/schoolserver.rst - -Activities - -.. toctree:: - :maxdepth: 1 - - content/what_is_an_activity.rst - content/launching_activities.rst - content/switching_activities.rst - content/collaborating.rst - content/exiting_activities.rst - content/browse.rst - content/calculate.rst - content/chat.rst - content/fototoon.rst - content/measure.rst - content/memorize.rst - content/paint.rst - content/pippy.rst - content/portfolio.rst - content/read.rst - content/record.rst - content/terminal.rst - content/tamtammini.rst - content/turtleart.rst - content/write.rst - -Network - -.. toctree:: - :maxdepth: 1 - - content/give_me_the_internet.rst - content/getting_connected.rst - content/troubleshooting_connectivity.rst - -Support - -.. toctree:: - :maxdepth: 1 - - content/upgrade_all.rst - content/getting_support.rst - -Appendices - -.. toctree:: - :maxdepth: 1 - - content/glossary.rst diff --git a/test.html b/test.html deleted file mode 100644 index c86895c..0000000 --- a/test.html +++ /dev/null @@ -1,453 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" /> -<title></title> -<style type="text/css"> - -/* -:Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 7434 2012-05-11 21:06:27Z milde $ -:Copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. - -See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to -customize this style sheet. -*/ - -/* used to remove borders from tables and images */ -.borderless, table.borderless td, table.borderless th { - border: 0 } - -table.borderless td, table.borderless th { - /* Override padding for "table.docutils td" with "! important". - The right padding separates the table cells. */ - padding: 0 0.5em 0 0 ! important } - -.first { - /* Override more specific margin styles with "! important". */ - margin-top: 0 ! important } - -.last, .with-subtitle { - margin-bottom: 0 ! important } - -.hidden { - display: none } - -a.toc-backref { - text-decoration: none ; - color: black } - -blockquote.epigraph { - margin: 2em 5em ; } - -dl.docutils dd { - margin-bottom: 0.5em } - -object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { - overflow: hidden; -} - -/* Uncomment (and remove this text!) to get bold-faced definition list terms -dl.docutils dt { - font-weight: bold } -*/ - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.admonition, div.attention, div.caution, div.danger, div.error, -div.hint, div.important, div.note, div.tip, div.warning { - margin: 2em ; - border: medium outset ; - padding: 1em } - -div.admonition p.admonition-title, div.hint p.admonition-title, -div.important p.admonition-title, div.note p.admonition-title, -div.tip p.admonition-title { - font-weight: bold ; - font-family: sans-serif } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif } - -/* Uncomment (and remove this text!) to get reduced vertical space in - compound paragraphs. -div.compound .compound-first, div.compound .compound-middle { - margin-bottom: 0.5em } - -div.compound .compound-last, div.compound .compound-middle { - margin-top: 0.5em } -*/ - -div.dedication { - margin: 2em 5em ; - text-align: center ; - font-style: italic } - -div.dedication p.topic-title { - font-weight: bold ; - font-style: normal } - -div.figure { - margin-left: 2em ; - margin-right: 2em } - -div.footer, div.header { - clear: both; - font-size: smaller } - -div.line-block { - display: block ; - margin-top: 1em ; - margin-bottom: 1em } - -div.line-block div.line-block { - margin-top: 0 ; - margin-bottom: 0 ; - margin-left: 1.5em } - -div.sidebar { - margin: 0 0 0.5em 1em ; - border: medium outset ; - padding: 1em ; - background-color: #ffffee ; - width: 40% ; - float: right ; - clear: right } - -div.sidebar p.rubric { - font-family: sans-serif ; - font-size: medium } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, -h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { - margin-top: 0.4em } - -h1.title { - text-align: center } - -h2.subtitle { - text-align: center } - -hr.docutils { - width: 75% } - -img.align-left, .figure.align-left, object.align-left { - clear: left ; - float: left ; - margin-right: 1em } - -img.align-right, .figure.align-right, object.align-right { - clear: right ; - float: right ; - margin-left: 1em } - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left } - -.align-center { - clear: both ; - text-align: center } - -.align-right { - text-align: right } - -/* reset inner alignment in figures */ -div.align-right { - text-align: inherit } - -/* div.align-center * { */ -/* text-align: left } */ - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.attribution { - text-align: right ; - margin-left: 50% } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.label { - white-space: nowrap } - -p.rubric { - font-weight: bold ; - font-size: larger ; - color: maroon ; - text-align: center } - -p.sidebar-title { - font-family: sans-serif ; - font-weight: bold ; - font-size: larger } - -p.sidebar-subtitle { - font-family: sans-serif ; - font-weight: bold } - -p.topic-title { - font-weight: bold } - -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font: inherit } - -pre.literal-block, pre.doctest-block, pre.math, pre.code { - margin-left: 2em ; - margin-right: 2em } - -pre.code .ln { /* line numbers */ - color: grey; -} - -.code { - background-color: #eeeeee -} - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option { - white-space: nowrap } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -span.section-subtitle { - /* font-size relative to parent (h1..h6 element) */ - font-size: 80% } - -table.citation { - border-left: solid 1px gray; - margin-left: 1px } - -table.docinfo { - margin: 2em 4em } - -table.docutils { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -table.footnote { - border-left: solid 1px black; - margin-left: 1px } - -table.docutils td, table.docutils th, -table.docinfo td, table.docinfo th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -table.docutils th.field-name, table.docinfo th.docinfo-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap ; - padding-left: 0 } - -h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, -h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { - font-size: 100% } - -ul.auto-toc { - list-style-type: none } - -</style> -</head> -<body> -<div class="document"> - - -<p>Introduction</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 4)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - about.rst - about_olpc.rst - about_sugar.rst - how_to_volunteer.rst - -</pre> -</div> -<p>Hardware</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 14)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - getting_started.rst - opening_the_xo.rst - starting_the_xo.rst - ports.rst - keyboard.rst - maintaining.rst - battery.rst - repair.rst - hardware_evolution.rst - -</pre> -</div> -<p>Software</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 29)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - home_view.rst - neighborhood_view.rst - group_view.rst - frame.rst - journal.rst - my_settings.rst - gnome.rst - schoolserver.rst - -</pre> -</div> -<p>Activities</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 43)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - what_is_an_activity.rst - launching_activities.rst - switching_activities.rst - collaborating.rst - browse.rst - calculate.rst - exiting_activities.rst - chat.rst - fototoon.rst - measure.rst - memorize.rst - paint.rst - pippy.rst - portfolio.rst - read.rst - terminal.rst - tamtammini.rst - turtleart.rst - write.rst - -</pre> -</div> -<p>Network</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 68)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - give_me_the_internet.rst - getting_connected.rst - troubleshooting_connectivity.rst - -</pre> -</div> -<p>Support</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 77)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - upgrade_all.rst - getting_support.rst - -</pre> -</div> -<p>Appendices</p> -<div class="system-message"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">index.rst</tt>, line 85)</p> -<p>Unknown directive type "toctree".</p> -<pre class="literal-block"> -.. toctree:: - :maxdepth: 1 - - glossary.rst - -</pre> -</div> -</div> -</body> -</html> |