translations.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  2. #
  3. # This file is part of PyQt6.
  4. #
  5. # This file may be used under the terms of the GNU General Public License
  6. # version 3.0 as published by the Free Software Foundation and appearing in
  7. # the file LICENSE included in the packaging of this file. Please review the
  8. # following information to ensure the GNU General Public License version 3.0
  9. # requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  10. #
  11. # If you do not wish to use this file under the terms of the GPL version 3.0
  12. # then you may purchase a commercial license. For more information contact
  13. # info@riverbankcomputing.com.
  14. #
  15. # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  16. # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  17. class Context:
  18. """ Encapsulate a message context. """
  19. def __init__(self, name):
  20. """ Initialise the context. """
  21. self.name = name
  22. self.messages = []
  23. class EmbeddedComments:
  24. """ Encapsulate information for a translator embedded in comments. """
  25. def __init__(self):
  26. """ Initialise the object. """
  27. self.message_id = ''
  28. self.extra_comments = []
  29. self.extras = []
  30. class Message:
  31. """ Encapsulate a message. """
  32. def __init__(self, filename, line_nr, source, comment, numerus):
  33. """ Initialise the message. """
  34. self.filename = filename
  35. self.line_nr = line_nr
  36. self.source = source
  37. self.comment = comment
  38. self.numerus = numerus
  39. self.embedded_comments = EmbeddedComments()