First steps for i18n support

* babel.cfg added;
* translations initialized for all endpoints;
* i18n tools cfgs added.

Partially implements blueprint savanna-i18n

Change-Id: I431d703c6193cc4af9324492209bda27075a78a8
This commit is contained in:
Sergey Lukjanov 2013-08-25 20:55:41 +04:00
parent ade56aca89
commit fefaa40de4
5 changed files with 14 additions and 0 deletions

1
babel.cfg Normal file
View File

@ -0,0 +1 @@
[python: **.py]

View File

@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import gettext
import os
import sys
@ -33,6 +34,8 @@ if os.path.exists(os.path.join(possible_topdir,
'__init__.py')):
sys.path.insert(0, possible_topdir)
gettext.install('savanna', unicode=1)
from savanna import config
from savanna.db import api as db_api
import savanna.main as server

View File

@ -13,8 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import gettext
from oslo.config import cfg
gettext.install('savanna', unicode=1)
from savanna.db import api as db_api

1
savanna/locale/README Normal file
View File

@ -0,0 +1 @@
Savanna translations

View File

@ -13,3 +13,8 @@ cover-inclusive=true
verbosity=3
detailed-errors=1
where=savanna/tests
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = savanna/locale/savanna.pot