Commit Graph
54 Commits
Author SHA1 Message Date
Athanasius f2ce63bfe7 l10n: Close localisation files after reading content
* These are opened in self.file() using codecs.open(), so no quick way
  to convert to a 'with'.
2021-04-01 14:45:50 +01:00
A_D 051245cf90 Renamed various config values to be backwards compatible 2021-04-01 14:45:48 +01:00
A_D 00629b7420 use _str versions of paths for string ops 2021-04-01 14:45:48 +01:00
A_D 281f66c7c1 Stringified plugin_dir for len check 2021-04-01 14:45:47 +01:00
A_D 965493ffed Silenced flake8 warning 2021-04-01 14:45:47 +01:00
A_D 6da85dc1e9 Fixed creating en.template.new as a dir 2021-04-01 14:45:47 +01:00
A_D dbc357ebcd Dont overwrite template files when generating new ones 2021-04-01 14:45:47 +01:00
A_D db06bc82af Resolved PR comments 2021-04-01 14:45:47 +01:00
A_D 1a563653da Missed a place to use pathlib.Path() 2021-04-01 14:45:47 +01:00
A_D 63dd6418b9 removed unicode strings 2021-04-01 14:45:47 +01:00
A_D 7a7b5821df refactored trinary logic 2021-04-01 14:45:47 +01:00
A_D b5282fc8ea Deprecated camelCase methods
Python prefers snake_case methods and camelCase classes. This replaces
some camelCase methods with snake_case variants, and has the original
names raise a DeprecationWarning before calling the snake_case versions
2021-04-01 14:45:47 +01:00
A_D ac7a1fa63e Replaced codecs.open with builtin open
In py2, open() did not support encodings, in py3 it does
2021-04-01 14:45:47 +01:00
A_D 6687dcbfef Made respath use pathlib paths 2021-04-01 14:45:47 +01:00
A_D e44039cfdd Replaced prints with logging 2021-04-01 14:45:47 +01:00
A_D 4ede555c13 Refactored return based logic
A good chunk of the logic in here was returning from branches but still
using else/elif/except branches to do an alternate behaviour.
2021-04-01 14:45:47 +01:00
A_D 553082c1fe Fixed some static type issues 2021-04-01 14:45:47 +01:00
A_D 13184a49b2 Added type annotations 2021-04-01 14:45:47 +01:00
A_D 07735bbff9 Renamed Translations and Locale
Previously at the end of l10n.py, the classes Translation and Locale
were overwritten with singleton instances of their types. This is both
bad practice and makes type checkers want to stab people. This change
should not affect any external code as the names they got for
Translations and Locale were the instances anyway.
2021-04-01 14:45:47 +01:00
A_D 7a0339a256 Added docstrings 2021-04-01 14:45:47 +01:00
A_D d9f91cf9dc Added whitespace around scope changes 2021-04-01 14:45:47 +01:00
A_D 20eee4c6c1 Cleaned up multiline statement 2021-04-01 14:45:47 +01:00
A_D 08bba395a9 Removed star import 2021-04-01 14:45:47 +01:00
A_D 7716cbd861 Removed bare excepts 2021-04-01 14:45:47 +01:00
A_D 3ba8be5bf7 Removed unneeded list comprehensions 2021-04-01 14:45:46 +01:00
A_D 8cee778a1b Removed modulo formatters 2021-04-01 14:45:46 +01:00
A_D 5ca2e06136 Fixed overlong lines 2021-04-01 14:45:46 +01:00
A_D b80c51bf78 auto-formatted code 2021-04-01 14:45:46 +01:00
Jonathan Harris 159bf95b77 All executable files invoked with #!/usr/bin/env python3 2019-09-30 02:50:52 +01:00
Athanasius b119974eb5 exe: l10n.py removal of un-needed .decode() calls 2019-09-26 11:44:15 +01:00
Athanasius 99bc019e14 l10n.py: De-future 2019-09-26 11:40:42 +01:00
Athanasius 218c068ee5 Running EDMarketConnector.py 'works'.
First pass utilising 'futurize' to do most of the work.

  There's an issue with ur'\"' in l10n.py which I'm not sure how to
properly fix.

  This now has errors when hitting the 'Update' button.
2019-09-26 11:40:38 +01:00
Jonathan Harris bf40b98819 Handle inability to get system language
Fixes #451
2019-09-21 18:11:22 +01:00
Jonathan Harris 3822cd61be Handle malformed plugin localisation files 2019-04-09 06:00:21 -07:00
Jonathan Harris 88f6e28e75 Workaround for inability to set locale - fallback to 'C' locale
Fixes #355
2018-10-28 10:41:30 +00:00
Jonathan Harris a9732ebb43 Fix plugin error on missing translation in default language 2018-05-29 02:15:50 +01:00
Jonathan Harris a442d2cd14 Extend localisation support to plugins 2018-05-12 20:50:45 +01:00
Jonathan Harris 929bd82684 Allow executable and plugins to be run from non-ASCII paths
Fixes #234
2017-08-19 16:03:39 +01:00
Jonathan Harris b206015eef Put plugins and strings in their own folders in packaged app
Load plugins with name 'plugin_*' in order to not pollute the global namespace.

Addresses #230
2017-08-16 14:36:12 +01:00
Jonathan Harris 2038d2b2cc Fix typo 2017-08-15 09:12:59 +01:00
Jonathan Harris e11224ea27 Add l10n.Locale object
Provides stringFromNumber() and numberFromString()
2017-07-29 15:36:42 +01:00
Jonathan Harris f0c18debda Handle escaped double-quotes in translations 2017-07-29 14:42:00 +01:00
Jonathan Harris 084128e797 Add support for internal plugins
Settings tab shows current plugins.
2017-07-29 14:41:59 +01:00
Jonathan Harris 5ee541ae68 Prioritize matching language script 2017-04-28 13:19:46 +01:00
Jonathan Harris 4945bee161 Support for changing language.
Fixes #61.
2016-02-07 18:50:02 +00:00
Jonathan Harris 2cd52e8377 Consolidate handling of data resource path. 2016-01-28 12:32:25 +00:00
Jonathan Harris abc5100b39 Restore stats display with remaining info - i.e. balance, ranks and ships.
Also make this info available from the command-line.
2015-11-25 16:14:33 +00:00
Jonathan Harris b0f60af38d Add command-line program. 2015-11-07 05:08:49 +00:00
Jonathan Harris be8d329492 Omit line numbers from translation files - too noisy in commit history. 2015-10-15 17:03:01 +01:00
Jonathan Harris a1a1a17987 Fix for English verification text. 2015-09-15 12:51:52 +01:00