Skip to content

Commit

Permalink
Make Arabic, Indonesian and Malaysian languages automatically load
Browse files Browse the repository at this point in the history
Re: #39.

- Move source files from dragonfly.language.other into separate
  sub-packages in-line with the English, Dutch and German
  implementations.
- Add entries to 'language_map' in dragonfly.language.loader so
  that the languages automatically load if engine.language is set
  to the relevant language code.
  • Loading branch information
drmfinlay committed Nov 13, 2018
1 parent 533e19c commit a542488
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 2 deletions.
21 changes: 21 additions & 0 deletions dragonfly/language/ar/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Dragonfly is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Dragonfly. If not, see
# <http://www.gnu.org/licenses/>.
#

from .number import IntegerContent, DigitsContent
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

"""
Arabic language implementations of Integer and Digits classes
Arabic (ar) language implementations of Integer and Digits classes
============================================================================
"""
Expand Down
21 changes: 21 additions & 0 deletions dragonfly/language/id/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Dragonfly is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Dragonfly. If not, see
# <http://www.gnu.org/licenses/>.
#

from .number import IntegerContent, DigitsContent
File renamed without changes.
3 changes: 3 additions & 0 deletions dragonfly/language/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ class LanguageSpecificLoader(object):
# speaker language.

language_map = {
"ar": "dragonfly.language.ar",
"de": "dragonfly.language.de",
"en": "dragonfly.language.en",
"id": "dragonfly.language.id",
"ms": "dragonfly.language.ms",
"nl": "dragonfly.language.nl",
}

Expand Down
21 changes: 21 additions & 0 deletions dragonfly/language/ms/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Dragonfly is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Dragonfly. If not, see
# <http://www.gnu.org/licenses/>.
#

from .number import IntegerContent, DigitsContent
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# multiple pronunciations.

"""
Maylaysian (ms) language implementations of Integer and Digits classes
Malaysian (ms) language implementations of Integer and Digits classes
============================================================================
"""
Expand Down
Empty file.

0 comments on commit a542488

Please sign in to comment.