You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.0 KiB

6 years ago
  1. """gettext tool
  2. """
  3. # Copyright (c) 2001 - 2017 The SCons Foundation
  4. #
  5. # Permission is hereby granted, free of charge, to any person obtaining
  6. # a copy of this software and associated documentation files (the
  7. # "Software"), to deal in the Software without restriction, including
  8. # without limitation the rights to use, copy, modify, merge, publish,
  9. # distribute, sublicense, and/or sell copies of the Software, and to
  10. # permit persons to whom the Software is furnished to do so, subject to
  11. # the following conditions:
  12. #
  13. # The above copyright notice and this permission notice shall be included
  14. # in all copies or substantial portions of the Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
  17. # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  18. # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. __revision__ = "src/engine/SCons/Tool/gettext_tool.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
  24. #############################################################################
  25. def generate(env,**kw):
  26. import SCons.Tool
  27. from SCons.Tool.GettextCommon \
  28. import _translate, tool_list
  29. for t in tool_list(env['PLATFORM'], env):
  30. env.Tool(t)
  31. env.AddMethod(_translate, 'Translate')
  32. #############################################################################
  33. #############################################################################
  34. def exists(env):
  35. from SCons.Tool.GettextCommon \
  36. import _xgettext_exists, _msginit_exists, \
  37. _msgmerge_exists, _msgfmt_exists
  38. try:
  39. return _xgettext_exists(env) and _msginit_exists(env) \
  40. and _msgmerge_exists(env) and _msgfmt_exists(env)
  41. except:
  42. return False
  43. #############################################################################