From 3a891e275ee5244197c0fc9e6d7ae3b872c1a032 Mon Sep 17 00:00:00 2001 From: Himadri Sekhar Basu <41947504+hsbasu@users.noreply.github.com> Date: Fri, 29 Dec 2023 10:45:49 +0530 Subject: [PATCH] Prepare translations (#59) - Add all files to be translated in POTFILES - Add .pot file - Add .pot update script --- POTFILES.in | 11 ++ setup.py | 31 ++++- simple-pwgen.pot | 326 +++++++++++++++++++++++++++++++++++++++++++++++ update-pot | 2 + 4 files changed, 363 insertions(+), 7 deletions(-) create mode 100644 POTFILES.in create mode 100644 simple-pwgen.pot create mode 100755 update-pot diff --git a/POTFILES.in b/POTFILES.in new file mode 100644 index 0000000..0cce89f --- /dev/null +++ b/POTFILES.in @@ -0,0 +1,11 @@ +data/org.mamolinux.simple-pwgen.gschema.xml.in +data/simple-pwgen.desktop.in +src/SimplePwgen/common.py +src/SimplePwgen/gui.py +src/SimplePwgen/__init__.py +src/SimplePwgen/main.py +src/SimplePwgen/ui/default-method.ui +src/SimplePwgen/ui/diceware-method.ui +src/SimplePwgen/ui/pin-generation.ui +src/SimplePwgen/ui/shortcuts.ui +src/SimplePwgen/ui/simple-pwgen.ui diff --git a/setup.py b/setup.py index 512be9f..fbd43b7 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,13 @@ -import glob, os -from subprocess import check_output +import glob +import os +import pathlib +import subprocess from setuptools import setup from distutils.log import info import distutils.command.install_data -for line in check_output('dpkg-parsechangelog --format rfc822'.split(), +for line in subprocess.check_output('dpkg-parsechangelog --format rfc822'.split(), universal_newlines=True).splitlines(): header, colon, value = line.lower().partition(':') if header == 'version': @@ -33,9 +35,24 @@ def run(self): gschema_dir = os.path.join(self.install_dir, gschema_dir_suffix) self.spawn(["glib-compile-schemas", gschema_dir]) +PO_FILES = 'po/simple-pwgen.po' + +def create_mo_files(): + mo_files = [] + prefix = 'simple-pwgen' + + for po_path in glob.glob(str(pathlib.Path(prefix) / PO_FILES)): + mo = pathlib.Path(po_path.replace('.po', '.mo')) + + subprocess.run(['msgfmt', '-o', str(mo), po_path], check=True) + mo_files.append(str(mo.relative_to(prefix))) + + return mo_files + setup(data_files=[('share/applications', glob.glob("data/applications/*.desktop")), - ('share/icons/hicolor/scalable/apps', glob.glob("data/icons/*")), - (gschema_dir_suffix, glob.glob("data/*.xml")) - ], - cmdclass = {'install_data': install_data} + ('share/icons/hicolor/scalable/apps', glob.glob("data/icons/*")), + (gschema_dir_suffix, glob.glob("data/schema/*.xml")), + ('share/locale', create_mo_files()) + ], + cmdclass = {'install_data': install_data} ) diff --git a/simple-pwgen.pot b/simple-pwgen.pot new file mode 100644 index 0000000..3619c18 --- /dev/null +++ b/simple-pwgen.pot @@ -0,0 +1,326 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-12-29 10:37+0530\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: data/simple-pwgen.desktop.in:3 src/SimplePwgen/gui.py:84 +#: src/SimplePwgen/gui.py:269 src/SimplePwgen/gui.py:279 +#: src/SimplePwgen/ui/simple-pwgen.ui:525 +msgid "Simple Password Generator" +msgstr "" + +#: data/simple-pwgen.desktop.in:4 +msgid "Very simple Python3-based GUI application to generate random password." +msgstr "" + +#: src/SimplePwgen/common.py:357 +msgid "Bad Password." +msgstr "" + +#: src/SimplePwgen/common.py:359 +msgid " Password is too short!" +msgstr "" + +#: src/SimplePwgen/common.py:373 +msgid " Only lower case used." +msgstr "" + +#: src/SimplePwgen/common.py:376 +msgid " No lower case used." +msgstr "" + +#: src/SimplePwgen/common.py:383 +msgid " Only UPPER case used." +msgstr "" + +#: src/SimplePwgen/common.py:386 +msgid " No UPPER case used." +msgstr "" + +#: src/SimplePwgen/common.py:391 +msgid " No special character used." +msgstr "" + +#: src/SimplePwgen/common.py:398 +msgid " Only digits used. Is It a PIN?" +msgstr "" + +#: src/SimplePwgen/common.py:401 +msgid " No digit used." +msgstr "" + +#: src/SimplePwgen/common.py:404 +msgid "" +"Looks like you know how to generate a Good Password. All types of characters " +"are used." +msgstr "" + +#: src/SimplePwgen/common.py:469 +#, python-format +msgid "%s years %s months %s days %s hours %s minutes %s seconds" +msgstr "" + +#: src/SimplePwgen/gui.py:166 +msgid "Keyboard Shortcuts" +msgstr "" + +#: src/SimplePwgen/gui.py:174 src/SimplePwgen/gui.py:277 +#: src/SimplePwgen/ui/shortcuts.ui:93 +msgid "About" +msgstr "" + +#: src/SimplePwgen/gui.py:180 src/SimplePwgen/ui/shortcuts.ui:107 +#: src/SimplePwgen/ui/simple-pwgen.ui:492 +msgid "Quit" +msgstr "" + +#: src/SimplePwgen/gui.py:281 +msgid "" +"Very simple Python3-based GUI application to generate secure and random " +"password." +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:51 +#: src/SimplePwgen/ui/diceware-method.ui:44 +msgid "Password Length:" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:66 +#: src/SimplePwgen/ui/diceware-method.ui:59 +msgid "Enter length of password" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:93 +msgid "Include Lowercase:" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:105 +msgid "" +"If this option is enabled, the lowercase letters will be included in the " +"password. ( e.g. \"a\" \"b\" \"c\" \"d\" ...)" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:119 +msgid "Minimum number of lowercase letters to be included." +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:122 +msgid "Minimum lowercases" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:136 +msgid "Exclude lowercase letters" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:150 +msgid "Include UPPERcase:" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:162 +msgid "" +"If this option is enabled, the UPPERcase letters will be included in the " +"password. ( e.g. \"A\" \"B\" \"C\" \"D\" ...)" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:176 +msgid "Minimum number of UPPERcase letters to be included." +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:179 +msgid "Minimum UPPERcases" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:194 +msgid "Exclude UPPERcase letters" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:208 +msgid "Include Digits:" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:220 +msgid "" +"If this option is enabled, the digits will be included in the password. ( e." +"g. \"0\" \"1\" \"2\" \"3\" ...)" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:234 +#: src/SimplePwgen/ui/pin-generation.ui:51 +msgid "Minimum number of Digits to be included." +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:237 +msgid "Minimum Digits" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:251 +#: src/SimplePwgen/ui/pin-generation.ui:69 +msgid "Exclude Digits" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:264 +msgid "Include Symbol:" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:276 +msgid "" +"If this option is enabled, the symbols and punctuation characters will be " +"included in the password. ( e.g. \"~\" \"!\" \"@\" \"+\" ...)" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:290 +msgid "Minimum number of Symbols or Puncuations to be included." +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:293 +msgid "Minimum Symbols" +msgstr "" + +#: src/SimplePwgen/ui/default-method.ui:306 +msgid "Exclude Symbols and Puncuations" +msgstr "" + +#: src/SimplePwgen/ui/pin-generation.ui:39 +msgid "PIN Length:" +msgstr "" + +#: src/SimplePwgen/ui/pin-generation.ui:54 +msgid "Enter length of PIN" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:41 +msgid "Passwords" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:46 src/SimplePwgen/ui/simple-pwgen.ui:477 +msgid "Generate" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:53 +msgid "Show/Hide" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:60 +msgid "Copy" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:68 +msgid "Settings" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:73 +msgid "Reset" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:80 src/SimplePwgen/ui/simple-pwgen.ui:93 +msgid "Save" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:88 +msgid "Other Shortcuts" +msgstr "" + +#: src/SimplePwgen/ui/shortcuts.ui:100 +msgid "Shortcuts" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:78 +msgid "Reset to Default" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:82 +msgid "Resets all values to defaults (Press Ctrl+R)" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:97 +msgid "Saves currents values as defaults (Press Ctrl+S)" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:133 +msgid "Generated Password:" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:163 +#: src/SimplePwgen/ui/simple-pwgen.ui:164 +msgid "Show/Hide password (Press Ctrl+H)" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:165 +msgid "Generated Password Shown Here" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:169 +msgid "password-text" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:184 +msgid "Copy generated password to clipboard (Press Ctrl+C)" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:233 +msgid "level-bar" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:284 +msgid "Password score out of 100" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:286 +msgid "Score(Out of 100):" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:312 +msgid "Number of arbitrary guesses required to crack the password" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:314 +msgid "Number of Guesses:" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:342 +msgid "Entropy of generated password" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:344 +msgid "Entropy:" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:370 +msgid "" +"Time that will be required by a computer with computing power 450 PetaFLOPS " +"to crack this password." +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:371 +msgid "Time required to crack:" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:414 +msgid "Comment:" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:481 +msgid "Generate new password(Press Ctrl+G)" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:496 +msgid "Quit(Press Ctrl+Q/Ctrl+W)" +msgstr "" + +#: src/SimplePwgen/ui/simple-pwgen.ui:526 +msgid "Generate secure and random passwords." +msgstr "" diff --git a/update-pot b/update-pot new file mode 100755 index 0000000..0c6457c --- /dev/null +++ b/update-pot @@ -0,0 +1,2 @@ +#!/bin/bash +xgettext --keyword=_ --keyword=N_ --output=simple-pwgen.pot -f POTFILES.in