<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=Localization</id>
	<title>Localization - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=Localization"/>
	<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=Localization&amp;action=history"/>
	<updated>2026-11-21T13:38:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=Localization&amp;diff=4063&amp;oldid=prev</id>
		<title>Ed at 17:41, 11 May 2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=Localization&amp;diff=4063&amp;oldid=prev"/>
		<updated>2020-05-11T17:41:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:41, 11 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;New attempt...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;New attempt...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We are writing a small dabo app, that needs a German and English locale (German is default) and is packaged on OSX with [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/del&gt;py2app&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;] (perhaps on Windows using [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/del&gt;py2exe&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;] later).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We are writing a small dabo app, that needs a German and English locale (German is default) and is packaged on OSX with [&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https://pypi.org/project/py2app/ &lt;/ins&gt;py2app] (perhaps on Windows using [&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https://www.py2exe.org/ &lt;/ins&gt;py2exe] later).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We use [http://babel.pocoo.org/en/latest/ Babel] and [https://poedit.net/ POedit] for translation.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We use [http://babel.pocoo.org/en/latest/ Babel] and [https://poedit.net/ POedit] for translation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=Localization&amp;diff=4062&amp;oldid=prev</id>
		<title>Ed at 17:39, 11 May 2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=Localization&amp;diff=4062&amp;oldid=prev"/>
		<updated>2020-05-11T17:39:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:39, 11 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l32&quot;&gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We are writing a small dabo app, that needs a German and English locale (German is default) and is packaged on OSX with [[py2app]] (perhaps on Windows using [[py2exe]] later).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We are writing a small dabo app, that needs a German and English locale (German is default) and is packaged on OSX with [[py2app]] (perhaps on Windows using [[py2exe]] later).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We use [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/del&gt;Babel&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;] and [https://poedit.net/ POedit] for translation.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We use [&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;http://babel.pocoo.org/en/latest/ &lt;/ins&gt;Babel] and [https://poedit.net/ POedit] for translation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The project tree looks like (fat names are directories):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The project tree looks like (fat names are directories):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=Localization&amp;diff=4061&amp;oldid=prev</id>
		<title>Ed: Created page with &quot;Localization is the ability to customize an app for the local language without having to change the source code. In the Dabo framework, we&#039;ve strived to wrap all strings that...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=Localization&amp;diff=4061&amp;oldid=prev"/>
		<updated>2020-05-11T17:38:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Localization is the ability to customize an app for the local language without having to change the source code. In the Dabo framework, we&amp;#039;ve strived to wrap all strings that...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Localization is the ability to customize an app for the local language without having to change the source code. In the Dabo framework, we&amp;#039;ve strived to wrap all strings that can be displayed to users in a localization function, which by convention in the Python world at least is named simply with the underscore character: &amp;lt;code&amp;gt;_()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here is a post from the dabo-dev list that helps explain our approach:&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt; Since you both appear to be working - could someone explain the&lt;br /&gt;
&amp;gt; following code:&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
raise dException.NoRecordsException, _(&amp;quot;No rows to sort.&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt; The part I don&amp;#039;t understand is the underscore?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the Python world, &amp;lt;code&amp;gt;_()&amp;lt;/code&amp;gt; is the standard name for the internationalization function: it takes a string and, depending on the settings, returns the proper localized translation of the original. In Dabo, it is nothing more than a placeholder for now; if we get some international developers involved in the future, they can write translations and hook them into the dLocalize program, allowing for localized apps without having to mess with the source code.&lt;br /&gt;
&lt;br /&gt;
Look at the top of any file where you see the underscore function; it will have a line like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from dabo.dLocalize import _&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
New attempt...&lt;br /&gt;
&lt;br /&gt;
We are writing a small dabo app, that needs a German and English locale (German is default) and is packaged on OSX with [[py2app]] (perhaps on Windows using [[py2exe]] later).&lt;br /&gt;
&lt;br /&gt;
We use [[Babel]] and [https://poedit.net/ POedit] for translation.&lt;br /&gt;
&lt;br /&gt;
The project tree looks like (fat names are directories):&lt;br /&gt;
&lt;br /&gt;
setup.py (see below)&lt;br /&gt;
ez_setup.py (from distutils)&lt;br /&gt;
translate.sh (see below)&lt;br /&gt;
makeit.sh (see below)&lt;br /&gt;
build (py2app&amp;#039;s build tree)&lt;br /&gt;
dist (py2app&amp;#039;s app target)&lt;br /&gt;
src&lt;br /&gt;
    main.py&lt;br /&gt;
    biz (our &amp;quot;functional&amp;quot; code, not shown)&lt;br /&gt;
    gui (our GUI code, not shown)&lt;br /&gt;
    icons (our application icon)&lt;br /&gt;
        appIcon.icns&lt;br /&gt;
        appIcon.png&lt;br /&gt;
    locale&lt;br /&gt;
        de&lt;br /&gt;
            LC_MESSAGES&lt;br /&gt;
            myapp.po&lt;br /&gt;
            myapp.mo&lt;br /&gt;
        en&lt;br /&gt;
            LC_MESSAGES&lt;br /&gt;
            myapp.po&lt;br /&gt;
            myapp.mo&lt;br /&gt;
        myapp.pot&lt;br /&gt;
&lt;br /&gt;
The main script contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
import dabo&lt;br /&gt;
&lt;br /&gt;
# i18n/i10n stuff&lt;br /&gt;
# better get the default locale setting from the OS! (doesn&amp;#039;t work for me, will add later)&lt;br /&gt;
dabo.settings.defaultLanguage = &amp;#039;de&amp;#039;&lt;br /&gt;
dabo.settings.firstDayOfWeek = &amp;#039;Monday&amp;#039;&lt;br /&gt;
&lt;br /&gt;
from dabo.dLocalize import _&lt;br /&gt;
dabo.dLocalize.install(&amp;#039;myapp&amp;#039;, os.path.join(os.path.dirname(__file__), &amp;#039;locale&amp;#039;), True)&lt;br /&gt;
dabo.dLocalize.setLanguage(&amp;#039;de&amp;#039;, &amp;#039;utf-8&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beware: order of the above commands matters! You&amp;#039;ll still get some wrong settings (e.g. date format), while [http://trac.dabodev.com/ticket/1298 http://trac.dabodev.com/ticket/1298] is unresolved.&lt;br /&gt;
&lt;br /&gt;
Of course all output strings are i18n-prepared like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
print _(u&amp;#039;Foo bar&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The setup script looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import ez_setup&lt;br /&gt;
ez_setup.use_setuptools()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import os, sys, glob&lt;br /&gt;
import dabo, dabo.icons&lt;br /&gt;
from setuptools import setup&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# locales:&lt;br /&gt;
daboDir = os.path.dirname(dabo.__file__)&lt;br /&gt;
localeDir = os.path.join(daboDir, &amp;#039;locale&amp;#039;)&lt;br /&gt;
locales = [&lt;br /&gt;
        (&amp;#039;lib/python2.6/dabo.locale/de/LC_MESSAGES&amp;#039;, (os.path.join(localeDir, &amp;#039;de&amp;#039;, &amp;#039;LC_MESSAGES&amp;#039;, &amp;#039;dabo.mo&amp;#039;),)),&lt;br /&gt;
        (&amp;#039;lib/python2.6/dabo.locale/en/LC_MESSAGES&amp;#039;, (os.path.join(localeDir, &amp;#039;en&amp;#039;, &amp;#039;LC_MESSAGES&amp;#039;, &amp;#039;dabo.mo&amp;#039;),)),&lt;br /&gt;
        (&amp;#039;locale/de/LC_MESSAGES&amp;#039;, (&amp;#039;src/locale/de/LC_MESSAGES/myapp.mo&amp;#039;,)),&lt;br /&gt;
        (&amp;#039;locale/en/LC_MESSAGES&amp;#039;, (&amp;#039;src/locale/en/LC_MESSAGES/myapp.mo&amp;#039;,)),&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# this would include all of dabo&amp;#039;s locales:&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
#locales = [(&amp;quot;dabo.locale&amp;quot;, (os.path.join(daboDir, &amp;quot;locale&amp;quot;, &amp;quot;dabo.pot&amp;quot;),))]&lt;br /&gt;
locales = []&lt;br /&gt;
def getLocales(arg, dirname, fnames):&lt;br /&gt;
    if &amp;quot;.svn&amp;quot; not in dirname and dirname[-1] != &amp;quot;\\&amp;quot;:&lt;br /&gt;
        mo_files = tuple(glob.glob(os.path.join(dirname, &amp;quot;*.mo&amp;quot;)))&lt;br /&gt;
        if mo_files:&lt;br /&gt;
            subdir = os.path.join(&amp;quot;dabo.locale&amp;quot;, dirname[len(arg)+1:])&lt;br /&gt;
            locales.append((subdir, mo_files))&lt;br /&gt;
os.path.walk(localeDir, getLocales, localeDir)&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
icons = [&lt;br /&gt;
         #(&amp;#039;lib/python2.6/dabo.icons&amp;#039;, tuple(glob.glob(os.path.join(daboDir, &amp;#039;icons&amp;#039;, &amp;#039;dabo*.png&amp;#039;)))) # if you need dabo&amp;#039;s icons&lt;br /&gt;
         (&amp;#039;icons&amp;#039;, tuple(glob.glob(&amp;#039;src/icons/appIcon.*&amp;#039;)))&lt;br /&gt;
         ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mainscript = &amp;#039;src/main.py&amp;#039;&lt;br /&gt;
NAME = &amp;#039;My App&amp;#039;&lt;br /&gt;
VERSION = &amp;#039;0.1.0&amp;#039;&lt;br /&gt;
APP = [mainscript]&lt;br /&gt;
DATA_FILES = locales + icons&lt;br /&gt;
APP_OPTIONS = {&lt;br /&gt;
               &amp;#039;argv_emulation&amp;#039;: True,&lt;br /&gt;
               &amp;#039;includes&amp;#039; : [&amp;#039;wx&amp;#039;, &amp;#039;wx.gizmos&amp;#039;, &amp;#039;wx.lib.calendar&amp;#039;, &amp;#039;dabo&amp;#039;, &amp;#039;Growl&amp;#039;, &amp;#039;ftputil&amp;#039;], #, &amp;#039;dabo.icons&amp;#039;,&lt;br /&gt;
               &amp;#039;excludes&amp;#039; : [&amp;#039;kinterbasdb&amp;#039;, &amp;#039;psycopg2&amp;#039;, &amp;#039;MySQLdb&amp;#039;, &amp;#039;numpy&amp;#039;, &amp;#039;wx.tools.Editra&amp;#039;, &amp;#039;wx.tools.XRCed&amp;#039;], # in this case, we don&amp;#039;t need database support&lt;br /&gt;
               &amp;#039;iconfile&amp;#039; : &amp;#039;src/icons/appIcon.icns&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
# included packages must not be zipped eggs, use easy_install -Z foo or pip unzip foo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXE_OPTIONS = {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plist = dict(&lt;br /&gt;
                          CFBundleName                  = NAME,&lt;br /&gt;
                          CFBundleShortVersionString    = VERSION,&lt;br /&gt;
                          CFBundleGetInfoString                = &amp;#039;%s %s&amp;#039; % (NAME, VERSION),&lt;br /&gt;
                          CFBundleExecutable                    = NAME,&lt;br /&gt;
                          CFBundleIdentifier                    = &amp;#039;com.example.myapp&amp;#039;,&lt;br /&gt;
                         # CFBundleDocumentTypes        = [&lt;br /&gt;
                         #                                 {&amp;#039;CFBundleTypeExtensions&amp;#039;: [&amp;#039;jpg&amp;#039;, &amp;#039;tif&amp;#039;, &amp;#039;bmp&amp;#039;],&lt;br /&gt;
                        #                                  &amp;#039;CFBundleTypeName&amp;#039;:&amp;#039;Image File&amp;#039;,&lt;br /&gt;
                        #                                   &amp;#039;CFBundleTypeRole&amp;#039;:&amp;#039;Viewer&amp;#039;}&lt;br /&gt;
                        #                                      ]&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# BEWARE Windows py2exe code is untested!&lt;br /&gt;
manifest = &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;assembly xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;br /&gt;
manifestVersion=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assemblyIdentity&lt;br /&gt;
    version=&amp;quot;0.64.1.0&amp;quot;&lt;br /&gt;
    processorArchitecture=&amp;quot;x86&amp;quot;&lt;br /&gt;
    name=&amp;quot;Controls&amp;quot;&lt;br /&gt;
    type=&amp;quot;win32&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;edNet Exporter&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;dependency&amp;gt;&lt;br /&gt;
    &amp;lt;dependentAssembly&amp;gt;&lt;br /&gt;
        &amp;lt;assemblyIdentity&lt;br /&gt;
            type=&amp;quot;win32&amp;quot;&lt;br /&gt;
            name=&amp;quot;Microsoft.Windows.Common-Controls&amp;quot;&lt;br /&gt;
            version=&amp;quot;6.0.0.0&amp;quot;&lt;br /&gt;
            processorArchitecture=&amp;quot;X86&amp;quot;&lt;br /&gt;
            publicKeyToken=&amp;quot;6595b64144ccf1df&amp;quot;&lt;br /&gt;
            language=&amp;quot;*&amp;quot;&lt;br /&gt;
        /&amp;gt;&lt;br /&gt;
    &amp;lt;/dependentAssembly&amp;gt;&lt;br /&gt;
&amp;lt;/dependency&amp;gt;&lt;br /&gt;
&amp;lt;/assembly&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if sys.platform == &amp;#039;darwin&amp;#039;:&lt;br /&gt;
    APP_OPTIONS[&amp;#039;plist&amp;#039;] = plist&lt;br /&gt;
    extra_options = dict(&lt;br /&gt;
        # Cross-platform applications generally expect sys.argv to&lt;br /&gt;
        # be used for opening files.&lt;br /&gt;
        setup_requires=[&amp;#039;py2app&amp;#039;],&lt;br /&gt;
        app=APP,&lt;br /&gt;
        options={&amp;#039;py2app&amp;#039;: APP_OPTIONS},&lt;br /&gt;
   &lt;br /&gt;
elif sys.platform == &amp;#039;win32&amp;#039;:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    windows = [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;script&amp;quot;: mainscript,&lt;br /&gt;
            &amp;quot;icon_resources&amp;quot;: [(1, &amp;quot;appIcon.png&amp;quot;)],&lt;br /&gt;
            &amp;quot;other_resources&amp;quot;: [(24,1,manifest)]&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
      data_files=[&amp;quot;src/icons/appIcon.png&amp;quot;]&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    extra_options = dict(&lt;br /&gt;
         script = mainscript,&lt;br /&gt;
         setup_requires=[&amp;#039;py2exe&amp;#039;],&lt;br /&gt;
         app=APP,&lt;br /&gt;
     )&lt;br /&gt;
else:&lt;br /&gt;
     extra_options = dict(&lt;br /&gt;
         # Normally unix-like platforms will use &amp;quot;setup.py install&amp;quot;&lt;br /&gt;
         # and install the main script as such&lt;br /&gt;
         scripts=APP,&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
setup(&lt;br /&gt;
    name=NAME,&lt;br /&gt;
    data_files=DATA_FILES,&lt;br /&gt;
    **extra_options&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
translate.sh controls pybabel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# Extract strings from Python files (make .pot) and update translation source (.po)&lt;br /&gt;
# use POedit to edit .po files and to compile translations to .mo!&lt;br /&gt;
LD=&amp;#039;./src/locale&amp;#039;&lt;br /&gt;
DOM=myapp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if [ ! -d &amp;quot;$LD&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
        mkdir $LD&lt;br /&gt;
fi&lt;br /&gt;
for L&lt;br /&gt;
do&lt;br /&gt;
        if [ ! -d &amp;quot;$LD/$L&amp;quot; ]&lt;br /&gt;
        then&lt;br /&gt;
                mkdir $LD/$L&lt;br /&gt;
        fi&lt;br /&gt;
        if [ ! -d &amp;quot;$LD/$L/LC_MESSAGES&amp;quot; ]&lt;br /&gt;
        then&lt;br /&gt;
                mkdir $LD/$L/LC_MESSAGES&lt;br /&gt;
        fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Extracting messages...&amp;quot;&lt;br /&gt;
pybabel extract -o $LD/$DOM.pot src&lt;br /&gt;
&lt;br /&gt;
for LOC in de en&lt;br /&gt;
do&lt;br /&gt;
        if [ ! -f $LD/$LOC/LC_MESSAGES/$DOM.po ]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;Making new locale $LOC&amp;quot;&lt;br /&gt;
                pybabel init -D $DOM -i $LD/$DOM.pot -l $LOC -d $LD&lt;br /&gt;
        else&lt;br /&gt;
                echo &amp;quot;Updating locale $LOC&amp;quot;&lt;br /&gt;
                pybabel update -D $DOM -i $LD/$DOM.pot -l $LOC -d $LD&lt;br /&gt;
        fi&lt;br /&gt;
        #echo &amp;quot;Compiling locale $LOC&amp;quot;&lt;br /&gt;
        #pybabel compile -D $DOM -i $LD/$LOC/LC_MESSAGES/$DOM.po -l $LOC -d $LD&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that open the .po files with [https://poedit.net/ POedit] (saving creates .mo files). If you don&amp;#039;t like POedit, edit the .po files in your favourite editor and run &amp;lt;code&amp;gt;pybabel compile&amp;lt;/code&amp;gt; (commented in the above script).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;makeit.sh&amp;lt;/code&amp;gt; cleans the previous build files and creates a new application in &amp;quot;dist&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
rm -R dist&lt;br /&gt;
rm -R build&lt;br /&gt;
mkdir build&lt;br /&gt;
echo &amp;quot;Making My App&amp;quot;&lt;br /&gt;
python setup.py py2app -O2 -b build/myapp &amp;gt; build/build.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
</feed>