Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Python3 #4

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion activity/activity.info
Expand Up @@ -3,7 +3,7 @@ name = Help
activity_version = 20
bundle_id = org.laptop.HelpActivity
icon = activity-help
exec = sugar-activity helpactivity.HelpActivity
exec = sugar-activity3 helpactivity.HelpActivity
license = GPLv3
summary = Having trouble using your computer or an activity? Want to learn more? Just click here!
categories = system
Expand Down
46 changes: 0 additions & 46 deletions po/Help.pot

This file was deleted.

24 changes: 12 additions & 12 deletions source/conf.py
Expand Up @@ -40,8 +40,8 @@
master_doc = 'index'

# General information about the project.
project = u'Sugar'
copyright = u'2015, SugarLabs'
project = 'Sugar'
copyright = '2015, SugarLabs'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -186,8 +186,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Sugar.tex', u'Sugar Documentation',
u'SugarLabs', 'manual'),
('index', 'Sugar.tex', 'Sugar Documentation',
'SugarLabs', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -216,8 +216,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'sugar', u'Sugar Documentation',
[u'SugarLabs'], 1)
('index', 'sugar', 'Sugar Documentation',
['SugarLabs'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -230,8 +230,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Sugar', u'Sugar Documentation',
u'SugarLabs', 'Sugar', 'One line description of project.',
('index', 'Sugar', 'Sugar Documentation',
'SugarLabs', 'Sugar', 'One line description of project.',
'Miscellaneous'),
]

Expand All @@ -248,10 +248,10 @@
# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'Sugar'
epub_author = u'SugarLabs'
epub_publisher = u'SugarLabs'
epub_copyright = u'2013, SugarLabs'
epub_title = 'Sugar'
epub_author = 'SugarLabs'
epub_publisher = 'SugarLabs'
epub_copyright = '2013, SugarLabs'

# The language of the text. It defaults to the language option
# or en if the language is not set.
Expand Down
14 changes: 7 additions & 7 deletions tools/seed_translation.py
Expand Up @@ -6,8 +6,8 @@
if len(sys.argv) > 1:
language_code = sys.argv[1]
else:
print "Usage seed_translation.py lang"
print " where lang is your two letteer ISO-639-1 language code"
print("Usage seed_translation.py lang")
print(" where lang is your two letteer ISO-639-1 language code")
exit()

po_files_dir = './translated_po/%s' % language_code
Expand All @@ -18,20 +18,20 @@
translator= Translator(to_lang=language_code)

for po_file_name in files:
print "TRANSLATE %s" % po_file_name
print("TRANSLATE %s" % po_file_name)
po = polib.pofile(os.path.join(po_files_dir, po_file_name))
for entry in po:
if translate_all or entry.msgstr == '':
print entry.msgid
print(entry.msgid)
sentences = entry.msgid.split('.')
translated_sentences = []
for sentence in sentences:
try:
translated_sentences.append(translator.translate(sentence))
except:
print "ERROR TRANSLATING SENTENCE '%s'" % sentence
print("ERROR TRANSLATING SENTENCE '%s'" % sentence)
translation = '. '.join(translated_sentences)
print translation
print "-" * 40
print(translation)
print("-" * 40)
entry.msgstr = translation.strip()
po.save(os.path.join(po_files_dir, po_file_name))
2 changes: 1 addition & 1 deletion tools/translate.py
Expand Up @@ -19,7 +19,7 @@
from textwrap import wrap
try:
import urllib2 as request
from urllib import quote
from urllib.parse import quote
except:
from urllib import request
from urllib.parse import quote
Expand Down
46 changes: 0 additions & 46 deletions translated_po/es/Help.po

This file was deleted.