pax_global_header00006660000000000000000000000064145767614410014531gustar00rootroot0000000000000052 comment=b3abe869e6c16c1de5aa7dfc0798333f524cfe85 deepin-gettext-tools-1.0.11/000077500000000000000000000000001457676144100156755ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/.github/000077500000000000000000000000001457676144100172355ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/.github/workflows/000077500000000000000000000000001457676144100212725ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/.github/workflows/backup-to-gitlab.yml000066400000000000000000000005371457676144100251470ustar00rootroot00000000000000name: backup to gitlab on: [push] concurrency: group: ${{ github.workflow }} cancel-in-progress: true jobs: backup-to-gitlabwh: uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master secrets: inherit backup-to-gitee: uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master secrets: inherit deepin-gettext-tools-1.0.11/.github/workflows/call-auto-tag.yml000066400000000000000000000005171457676144100244520ustar00rootroot00000000000000name: auto tag on: pull_request_target: types: [opened, synchronize, closed] paths: - "debian/changelog" concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: auto_tag: uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master secrets: inherit deepin-gettext-tools-1.0.11/.github/workflows/call-build-distribution.yml000066400000000000000000000004321457676144100265410ustar00rootroot00000000000000name: Call build-distribution on: push: paths-ignore: - ".github/workflows/**" pull_request_target: paths-ignore: - ".github/workflows/**" jobs: check_job: uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master secrets: inherit deepin-gettext-tools-1.0.11/.github/workflows/call-chatOps.yml000066400000000000000000000002421457676144100243250ustar00rootroot00000000000000name: chatOps on: issue_comment: types: [created] jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master secrets: inherit deepin-gettext-tools-1.0.11/.github/workflows/call-clacheck.yml000066400000000000000000000005251457676144100244650ustar00rootroot00000000000000name: Call CLA check on: issue_comment: types: [created] pull_request_target: types: [opened, closed, synchronize] concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: clacheck: uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master secrets: inherit deepin-gettext-tools-1.0.11/.github/workflows/call-commitlint.yml000066400000000000000000000003641457676144100251100ustar00rootroot00000000000000name: Call commitlint on: pull_request_target: concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: check_job: uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master deepin-gettext-tools-1.0.11/.github/workflows/call-license-check.yml000066400000000000000000000005521457676144100254250ustar00rootroot00000000000000name: Call License and README Check on: pull_request_target: types: [opened, synchronize, reopened] permissions: pull-requests: write contents: read concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: license-check: uses: linuxdeepin/.github/.github/workflows/license-check.yml@master deepin-gettext-tools-1.0.11/.gitignore000066400000000000000000000001761457676144100176710ustar00rootroot00000000000000*.pyc nohup.out .#* *~ build dist dtk.egg-info *.po~ *.swp *.user.* *.old *.mo Makefile *.cache *.o build lib mkspecs *.user deepin-gettext-tools-1.0.11/.obs/000077500000000000000000000000001457676144100165365ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/.obs/workflows.yml000066400000000000000000000023121457676144100213140ustar00rootroot00000000000000test_build: steps: - link_package: source_project: deepin:Develop:dde source_package: %{SCM_REPOSITORY_NAME} target_project: deepin:CI - configure_repositories: project: deepin:CI repositories: - name: deepin_develop paths: - target_project: deepin:CI target_repository: deepin_develop architectures: - x86_64 - aarch64 - name: debian paths: - target_project: deepin:CI target_repository: debian_sid architectures: - x86_64 - name: archlinux paths: - target_project: deepin:CI target_repository: archlinux architectures: - x86_64 filters: event: pull_request tag_build: steps: - branch_package: source_project: deepin:Develop:dde source_package: %{SCM_REPOSITORY_NAME} target_project: deepin:Unstable:dde filters: event: tag_push commit_build: steps: - trigger_services: project: deepin:Develop:dde package: %{SCM_REPOSITORY_NAME} filters: event: push deepin-gettext-tools-1.0.11/.reuse/000077500000000000000000000000001457676144100170765ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/.reuse/dep5000066400000000000000000000020001457676144100176460ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: deepin-gettext-tools Upstream-Contact: UnionTech Software Technology Co., Ltd. <> Source: https://github.com/linuxdeepin/deepin-gettext-tools # README Files: README.md README.zh_CN.md CHANGELOG.md Copyright: None License: CC-BY-4.0 # Project file Files: Makefile Copyright: None License: CC0-1.0 # ci Files: .github/* .gitlab-ci.yml .obs/workflows.yml Copyright: None License: CC0-1.0 # gitignore Files: .gitignore Copyright: None License: CC0-1.0 # clog Files: .clog.toml Copyright: None License: CC0-1.0 # debian rpm archlinux Files: debian/* rpm/* archlinux/* Copyright: None License: CC0-1.0 # py Files: src/*.py Copyright: UnionTech Software Technology Co., Ltd. License: GPL-2.0-or-later # ini Files: src/example_config.ini Copyright: UnionTech Software Technology Co., Ltd. License: GPL-2.0-or-later # pl Files: src/desktop_ts_convert.pl Copyright: UnionTech Software Technology Co., Ltd. License: GPL-2.0-or-later deepin-gettext-tools-1.0.11/CHANGELOG.md000066400000000000000000000000741457676144100175070ustar00rootroot00000000000000 ## [1.0.8] 2018-03-09 * fix ts2policy KeyError exception deepin-gettext-tools-1.0.11/LICENSE000066400000000000000000000432541457676144100167120ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. deepin-gettext-tools-1.0.11/LICENSES/000077500000000000000000000000001457676144100171025ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/LICENSES/CC-BY-4.0.txt000066400000000000000000000411771457676144100207510ustar00rootroot00000000000000Creative Commons Attribution 4.0 International Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. Using Creative Commons Public Licenses Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Section 1 – Definitions. a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. Section 2 – Scope. a. License grant. 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: A. reproduce and Share the Licensed Material, in whole or in part; and B. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 3. Term. The term of this Public License is specified in Section 6(a). 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 5. Downstream recipients. A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). b. Other rights. 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 2. Patent and trademark rights are not licensed under this Public License. 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. Section 3 – License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. a. Attribution. 1. If You Share the Licensed Material (including in modified form), You must: A. retain the following if it is supplied by the Licensor with the Licensed Material: i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); ii. a copyright notice; iii. a notice that refers to this Public License; iv. a notice that refers to the disclaimer of warranties; v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. Section 4 – Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. Section 5 – Disclaimer of Warranties and Limitation of Liability. a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. Section 6 – Term and Termination. a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 2. upon express reinstatement by the Licensor. c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. Section 7 – Other Terms and Conditions. a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. Section 8 – Interpretation. a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. deepin-gettext-tools-1.0.11/LICENSES/CC0-1.0.txt000066400000000000000000000156101457676144100205070ustar00rootroot00000000000000Creative Commons Legal Code CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. Statement of Purpose The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; ii. moral rights retained by the original author(s) and/or performer(s); iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; v. rights protecting the extraction, dissemination, use and reuse of data in a Work; vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 4. Limitations and Disclaimers. a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. deepin-gettext-tools-1.0.11/LICENSES/GPL-2.0-or-later.txt000066400000000000000000000416711457676144100223160ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice deepin-gettext-tools-1.0.11/Makefile000066400000000000000000000012261457676144100173360ustar00rootroot00000000000000PREFIX = /usr build: install: mkdir -pv ${DESTDIR}${PREFIX}/lib/deepin-gettext-tools mkdir -pv ${DESTDIR}${PREFIX}/bin install -m755 src/generate_mo.py ${DESTDIR}${PREFIX}/lib/deepin-gettext-tools/ install -m755 src/update_pot.py ${DESTDIR}${PREFIX}/lib/deepin-gettext-tools/ ln -sf ${PREFIX}/lib/deepin-gettext-tools/generate_mo.py ${DESTDIR}${PREFIX}/bin/deepin-generate-mo ln -sf ${PREFIX}/lib/deepin-gettext-tools/update_pot.py ${DESTDIR}${PREFIX}/bin/deepin-update-pot install -m755 src/desktop_ts_convert.pl ${DESTDIR}${PREFIX}/bin/deepin-desktop-ts-convert install -m755 src/policy_ts_convert.py ${DESTDIR}${PREFIX}/bin/deepin-policy-ts-convert deepin-gettext-tools-1.0.11/README.md000066400000000000000000000021071457676144100171540ustar00rootroot00000000000000# deepin-gettext-tools deepin-gettext-tools is convenient tool for desktop file translation. ## Dependencies You can also check the "Depends" provided in the `debian/control` file. ### Build dependencies You can also check the "Build-Depends" provided in the `debian/control` file. ## Installation ### Build from source code 1. Make sure you have installed all dependencies. ```bash sudo apt build-dep deepin-gettext-tools ``` 2. Build ```bash mkdir build cd build cmake .. make ``` 3. Install ```bash sudo make install ``` ## Getting help Any usage issues can ask for help via * [Matrix](https://matrix.to/#/#deepin-community:matrix.org) * [WiKi](https://wiki.deepin.org) * [Forum](https://bbs.deepin.org) * [Developer Center](https://github.com/linuxdeepin/developer-center/issues) ## Getting involved We encourage you to report issues and contribute changes - [**Contribution guide for developers**](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en) ## License deepin-gettext-tools is licensed under [GPL-2.0-or-later](LICENSE). deepin-gettext-tools-1.0.11/README.zh_CN.md000066400000000000000000000057331457676144100201640ustar00rootroot00000000000000# deepin-gettext-tools 处理 desktop 文件翻译的便捷工具 有关如何使用可参考项目 [deepin-feedback](https://github.com/linuxdeepin/deepin-feedback) ## 子命令介绍 有3个子命令: init, desktop2ts, ts2desktop。如果不带任何参数运行本命令则显示帮助信息。 ### 子命令 init ``` deepin-desktop-ts-convert init $desktopFile $outputTsDir ``` 用于在项目中开始处理一个desktop文件的翻译问题,将翻译源写入`$outputTsDir/desktop.ts`文件,和已有的翻译成果写入各个 `$outputTsDir/desktop_.ts` 文件中(`` 是指某种具体的语言代码)。 ### 子命令 desktop2ts ``` deepin-desktop-ts-convert desktop2ts $desktopFile $outputTsDir ``` 子命令 desktop2ts 与子命令 init 传参是一样的,用于更新翻译源文件,将翻译源写入`$outputTsDir/desktop.ts`文件。应该在 desktop 文件中的可以本地化的字段的值被更新后使用,相关字段有 Name,Comment,GenericName,Keywords。 ### 子命令 ts2desktop ``` deepin-desktop-ts-convert ts2desktop $desktopFile $tsDir $outputDesktopFile ``` 用于输出带有翻译结果的 desktop 文件,参数 `$desktopFile` 是模板文件,参数 `$tsDir` 是放置相关 ts 文件的文件夹,将集合了各种语言翻译成果的desktop写入`$outputDesktopFile`文件。推荐在构建软件包过程中使用。 ## 推荐使用流程 ### 开始一个新项目 1. 如果 desktop 文件中已有翻译,使用 init 子命令,否则使用 deskotp2ts 子命令; 2. 将 desktop 文件的后缀改为 `.desktop.in` 作为一个模板,去除里面的翻译; 3. 在 Makefile 里面写一个构建项 ts,当 desktop.in 文件中相关字段的值更新后,执行 make ts; 4. 在 .tx/config 写好资源配置; 5. 在 Makefile 中的 build 项中增加使用 ts2desktop 子命令; 6. 用 ci 的 [sync-transifex](https://ci.deepin.io/view/tools/job/sync-transifex/) 上传翻译源文件; 7. 如果已有一些翻译成果,找翻译管理员,`git clone` 你的项目,然后执行 `tx push -t` 命令上传翻译,tx 命令由软件包 transifex-client 提供; ### 更新翻译成果 1. 用 ci 的 sync-transifex 拉取翻译结果 ### 更新模板文件 desktop.in,修改了本地化相关字段 1. 使用 desktop2ts 子命令; 2. 将模板文件 desktop.in 和它的翻译源文件 desktop.ts 在 git 中提交; 3. 用 ci 的 sync-transifex 上传翻译源文件; ## 帮助 任何使用问题都可以通过以下方式寻求帮助: * [Matrix](https://matrix.to/#/#deepin-community:matrix.org) * [WiKi](https://wiki.deepin.org) * [官方论坛](https://bbs.deepin.org) * [开发者中心](https://github.com/linuxdeepin/developer-center/issues) ## 贡献指南 我们鼓励您报告问题并做出更改 - [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) ## 开源许可证 deepin-gettext-tools 在 [GPL-2.0-or-later](LICENSE) 下发布。 deepin-gettext-tools-1.0.11/archlinux/000077500000000000000000000000001457676144100176725ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/archlinux/PKGBUILD000066400000000000000000000016011457676144100210140ustar00rootroot00000000000000# Maintainer: justforlxz pkgname=deepin-gettext-tools-git pkgver=1.0.8.r5.gc913e2d pkgrel=1 sourcename=deepin-gettext-tools sourcetars=("$sourcename"_"$pkgver".tar.xz) sourcedir="$sourcename" pkgdesc='Deepin Gettext Tools' arch=('any') url="https://github.com/linuxdeepin/deepin-gettext-tools" license=('GPL3') depends=('gettext' 'python' 'perl-config-tiny' 'perl-xml-libxml') makedepends=('git') conflicts=('deepin-gettext-tools') provides=('deepin-gettext-tools') groups=('deepin-git') source=("${sourcetars[@]}") sha512sums=('SKIP') prepare() { cd $sourcedir sed -e 's/sudo cp/cp/' -i src/generate_mo.py sed -e 's/qmake/qmake-qt5/' -e '/lupdate/d' -i Makefile } check() { cd $sourcedir perl src/desktop_ts_convert.pl --help python src/generate_mo.py --help python src/update_pot.py --help } package() { cd $sourcedir make DESTDIR="$pkgdir" install } deepin-gettext-tools-1.0.11/debian/000077500000000000000000000000001457676144100171175ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/debian/changelog000066400000000000000000000016401457676144100207720ustar00rootroot00000000000000deepin-gettext-tools (1.0.11) unstable; urgency=medium * update debian source format -- hudeng Thu, 21 Mar 2024 12:12:10 +0800 deepin-gettext-tools (1.0.6-1) unstable; urgency=medium * New upstream release. -- Boyuan Yang <073plan@gmail.com> Mon, 28 Aug 2017 15:11:02 +0800 deepin-gettext-tools (1.0.3) unstable; urgency=low * Autobuild Tag 1.0.3 -- TagBuilder Mon, 23 May 2016 12:49:59 +0000 deepin-gettext-tools (1.0.1-1) stable; urgency=low * Autobuild Tag 1.0.1 -- TagBuilder Fri, 14 Aug 2015 09:53:56 +0000 deepin-gettext-tools (1.0.0-1) stable; urgency=low * Autobuild Tag 1.0.0-1 -- TagBuilder Wed, 01 Jul 2015 08:11:33 +0000 deepin-gettext-tools (0.0.0) unstable; urgency=low * Unstable release. -- 宋文武 Thu, 18 Sep 2014 11:28:07 +0800 deepin-gettext-tools-1.0.11/debian/compat000066400000000000000000000000021457676144100203150ustar00rootroot000000000000009 deepin-gettext-tools-1.0.11/debian/control000066400000000000000000000012071457676144100205220ustar00rootroot00000000000000Source: deepin-gettext-tools Section: devel Priority: optional Build-Depends: debhelper (>= 9), Standards-Version: 4.0.0 Maintainer: Deepin Sysdev Homepage: https://github.com/linuxdeepin/deepin-gettext-tools Package: deepin-gettext-tools Architecture: all Depends: gettext, libconfig-tiny-perl, libxml-libxml-perl, perl, python3, ${misc:Depends}, Description: Deepin Internationalization utilities This package provides various tools used by Deepin software to extract translatable string and manage i18n works as a supplement to regular gettext tools. . This package is part of DDE (Deepin Desktop Environment). deepin-gettext-tools-1.0.11/debian/copyright000066400000000000000000000016631457676144100210600ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: deepin-gettext-tools Files: * Copyright: 2010-2021 Deepin Technology Co., Ltd. License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package 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 General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". deepin-gettext-tools-1.0.11/debian/deepin-desktop-ts-convert.1000066400000000000000000000053131457676144100242200ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2017 Boyuan Yang <073plan@gmail.com>, .\" .TH "DEEPIN-DESKTOP-TS-CONVERT" "1" "2017-08-11" "Deepin Gettext Tools" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME deepin-desktop-ts-convert \- convert between .desktop file and .ts file to ease translation .SH SYNOPSIS .B deepin-desktop-ts-convert init \fIdesktopFile outputTsDir\fR .br .B deepin-desktop-ts-convert desktop2ts \fIdesktopFile outputTsDir\fR .br .B deepin-desktop-ts-convert ts2desktop \fIdesktopFile tsDir outputDesktopFile\fR .SH DESCRIPTION This manual page documents briefly the .B deepin-desktop-ts-convert command as provided by .B deepin-gettext-tools package. .PP \fBdeepin-desktop-ts-convert\fP is a utility that helps developers convert translatable strings in desktop files into ts files to ease translation work. Translated strings in ts files can be merged back to original desktop file too with the help of this utility. .PP Such workflow is adopted by most Deepin software. .SH USAGE .PP To initialise conversion, use \fIdeepin-desktop-ts-convert init\fR subcommand. In which case source ts file will be put into \fIoutputTsDir/desktop.ts\fR and translation ts files should be named as \fIoutputTsDir/desktop_\.ts\fR. .sp .if n \{\ .RS 4 .\} .nf deepin-desktop-ts-convert init desktopFile outputTsDir .fi .if n \{\ .RE .\} .PP To update ts files from a new version of desktop file, use \fIdeepin-desktop-ts-convert desktop2ts\fR subcommand. The updated ts file given as outputTsDir/desktop.ts file. .sp .if n \{\ .RS 4 .\} .nf deepin-desktop-ts-convert desktop2ts desktopFile outputTsDir .fi .if n \{\ .RE .\} .PP To generate translated desktop files, use \fIdeepin-desktop-ts-convert ts2desktop\fR subcommand. .sp .if n \{\ .RS 4 .\} .nf deepin-desktop-ts-convert ts2desktop desktopFile tsDir outputDesktopFile .fi .if n \{\ .RE .\} .SH SEE ALSO .PP .BR deepin-update-pot (1), .BR deepin-generate-mo (1), .BR deepin-policy-ts-convert (1). .PP The programs are further documented in the .IR README.md as provided with this debian package under .IR /usr/share/doc/deepin-gettext-tools/ directory. .SH AUTHOR .PP .B deepin-gettext-tools is written by Deepin Technology Co., Ltd. .PP This manual page was written by .MT 073plan@\:gmail.com Boyuan Yang .ME for the Debian Project (but may be used by others). deepin-gettext-tools-1.0.11/debian/deepin-generate-mo.1000066400000000000000000000036561457676144100226600ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2017 Boyuan Yang <073plan@gmail.com>, .\" .TH "DEEPIN-GENERATE-MO" "1" "2017-08-11" "Deepin Gettext Tools" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME deepin-generate-mo \- generate mo file from po file using deepin ini config file .SH SYNOPSIS .B deepin-generate-mo .RI [ \-h\ \-\-copy ] " inifile" .SH DESCRIPTION This manual page documents briefly the .B deepin-generate-mo command as provided by .B deepin-gettext-tools package. .PP \fBdeepin-generate-mo\fP is a utility that generate gettext MO files from gettext PO files using instructions from certain ini config file. .PP Such workflow is adopted by most Deepin software. .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For latest descriptions as provided by the tool, invoke the tool with \fI\-h\fR option. .TP .B \-h, \-\-help Show help messages and exit. .TP .B \-\-copy Also execute commands similar to "sudo cp *.mo /usr/share/locale". .SH SEE ALSO .PP .BR deepin-update-pot (1), .BR deepin-desktop-ts-convert (1), .BR deepin-policy-ts-convert (1). .PP The programs are further documented in the .IR README.md as provided with this debian package under .IR /usr/share/doc/deepin-gettext-tools/ directory. .SH AUTHOR .PP .B deepin-gettext-tools is written by Deepin Technology Co., Ltd. .PP This manual page was written by .MT 073plan@\:gmail.com Boyuan Yang .ME for the Debian Project (but may be used by others). deepin-gettext-tools-1.0.11/debian/deepin-gettext-tools.examples000066400000000000000000000000271457676144100247420ustar00rootroot00000000000000src/example_config.ini deepin-gettext-tools-1.0.11/debian/deepin-policy-ts-convert.1000066400000000000000000000037061457676144100240520ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2017 Boyuan Yang <073plan@gmail.com>, .\" .TH "DEEPIN-POLICY-TS-CONVERT" "1" "2017-08-11" "Deepin Gettext Tools" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME deepin-policy-ts-convert \- convert between policykit XML file and ts file to ease translation .SH SYNOPSIS .B deepin-policy-ts-convert init \fIpolicyFile outputTsDir\fR .br .B deepin-policy-ts-convert policy2ts \fIpolicyFile outputTsDir\fR .br .B deepin-policy-ts-convert ts2policy \fIpolicyFile tsDir outputPolicyFile\fR .SH DESCRIPTION This manual page documents briefly the .B deepin-policy-ts-convert command as provided by .B deepin-gettext-tools package. .PP \fBdeepin-policy-ts-convert\fP is a utility that helps developers convert translatable strings in PolicyKit XML files into ts files to ease translation work. Translated ts files can be merged back to original file too with the help of this utility. .PP Such workflow is adopted by most Deepin software. .SH USAGE Using this tool is similar to using \fBdeepin-desktop-ts-convert\fR(1) as shown in the SYNOPSIS section. .SH SEE ALSO .PP .BR deepin-update-pot (1), .BR deepin-generate-mo (1), .BR deepin-desktop-ts-convert (1), .PP The programs are further documented in the .IR README.md as provided with this debian package under .IR /usr/share/doc/deepin-gettext-tools/ directory. .SH AUTHOR .PP .B deepin-gettext-tools is written by Deepin Technology Co., Ltd. .PP This manual page was written by .MT 073plan@\:gmail.com Boyuan Yang .ME for the Debian Project (but may be used by others). deepin-gettext-tools-1.0.11/debian/deepin-update-pot.1000066400000000000000000000035211457676144100225260ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2017 Boyuan Yang <073plan@gmail.com>, .\" .TH "DEEPIN-UPDATE-POT" "1" "2017-08-11" "Deepin Gettext Tools" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME deepin-update-pot \- generate pot file according to given ini config file .SH SYNOPSIS .B deepin-update-pot .RI [ \-h ] " inifile" .SH DESCRIPTION This manual page documents briefly the .B deepin-update-pot command as provided by .B deepin-gettext-tools package. .PP \fBdeepin-update-pot\fP is a utility that generate gettext POT template file from source code files using instructions from certain ini config file. .PP Such workflow is adopted by most Deepin software. .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For latest descriptions as provided by the tool, invoke the tool with \fI\-h\fR option. .TP .B \-h, \-\-help Show help messages and exit. .SH SEE ALSO .PP .BR deepin-generate-mo (1), .BR deepin-desktop-ts-convert (1), .BR deepin-policy-ts-convert (1). .PP The programs are further documented in the .IR README.md as provided with this debian package under .IR /usr/share/doc/deepin-gettext-tools/ directory. .SH AUTHOR .PP .B deepin-gettext-tools is written by Deepin Technology Co., Ltd. .PP This manual page was written by .MT 073plan@\:gmail.com Boyuan Yang .ME for the Debian Project (but may be used by others). deepin-gettext-tools-1.0.11/debian/docs000066400000000000000000000000121457676144100177630ustar00rootroot00000000000000README.md deepin-gettext-tools-1.0.11/debian/manpages000066400000000000000000000001741457676144100206370ustar00rootroot00000000000000debian/deepin-generate-mo.1 debian/deepin-update-pot.1 debian/deepin-desktop-ts-convert.1 debian/deepin-policy-ts-convert.1 deepin-gettext-tools-1.0.11/debian/rules000077500000000000000000000000361457676144100201760ustar00rootroot00000000000000#!/usr/bin/make -f %: dh $@ deepin-gettext-tools-1.0.11/debian/source/000077500000000000000000000000001457676144100204175ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/debian/source/format000066400000000000000000000000151457676144100216260ustar00rootroot000000000000003.0 (native) deepin-gettext-tools-1.0.11/debian/watch000066400000000000000000000003151457676144100201470ustar00rootroot00000000000000version=4 opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%deepin-gettext-tools-$1.tar.gz%" \ https://github.com/linuxdeepin/deepin-gettext-tools/tags \ (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate deepin-gettext-tools-1.0.11/rpm/000077500000000000000000000000001457676144100164735ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/rpm/deepin-gettext-tools.spec000066400000000000000000000036211457676144100234350ustar00rootroot00000000000000Name: deepin-gettext-tools Version: 1.0.9 Release: 1 Summary: Deepin Gettext Tools License: GPLv3 URL: https://github.com/linuxdeepin/deepin-gettext-tools Source0: %{name}-%{version}.orig.tar.gz BuildArch: noarch BuildRequires: perl-XML-LibXML BuildRequires: python3-devel BuildRequires: perl(Config::Tiny) Requires: gettext Requires: qt5-linguist Requires: perl(Config::Tiny) Requires: perl(Exporter::Tiny) Requires: perl(XML::LibXML) Requires: perl(XML::LibXML::PrettyPrint) %description The tools of gettext function wrapper. desktop-ts-convert - handling desktop file translations. policy-ts-convert - convert PolicyKit Policy file to the ts file. update-pot - scan msgid and generate pot file according to the ini file. generate-mo - scan po files and generate mo files according to the ini file. %prep %setup -q # fix shebang find -iname "*.py" | xargs sed -i '1s|.*|#!%{__python3}|' sed -i '1s|.*|#!%{__perl}|' src/desktop_ts_convert.pl sed -i 's|sudo cp|cp|' src/generate_mo.py sed -i 's|lconvert|lconvert-qt5|; s|deepin-lupdate|lupdate-qt5|' src/update_pot.py %build %install install -d %{buildroot}%{_bindir} install -m755 src/desktop_ts_convert.pl %{buildroot}%{_bindir}/deepin-desktop-ts-convert install -m755 src/policy_ts_convert.py %{buildroot}%{_bindir}/deepin-policy-ts-convert install -m755 src/generate_mo.py %{buildroot}%{_bindir}/deepin-generate-mo install -m755 src/update_pot.py %{buildroot}%{_bindir}/deepin-update-pot %check /bin/perl src/desktop_ts_convert.pl --help /bin/python3 src/generate_mo.py --help /bin/python3 src/update_pot.py --help %files %doc README.md %license LICENSE %{_bindir}/deepin-desktop-ts-convert %{_bindir}/deepin-policy-ts-convert %{_bindir}/deepin-update-pot %{_bindir}/deepin-generate-mo %changelog * Thu Mar 23 2021 uoser - 1.0.9-1 - Update to 1.0.9 deepin-gettext-tools-1.0.11/src/000077500000000000000000000000001457676144100164645ustar00rootroot00000000000000deepin-gettext-tools-1.0.11/src/desktop_ts_convert.pl000066400000000000000000000253301457676144100227430ustar00rootroot00000000000000#!/usr/bin/env perl # # The desktop-ts-convert tool # # Copyright (C) 2017 Deepin.Inc # # desktop-ts-convert is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 3 published by the Free Software Foundation. # use warnings; use strict; use 5.018; use XML::LibXML; use Config::Tiny; use File::Basename qw(basename); use File::Path qw(make_path); my @localeKeys = qw(Name GenericName Comment Keywords); MAIN: { my $cmd = shift @ARGV // ''; if ($cmd eq 'init') { my ($desktopFile, $outputTsDir) = @ARGV; Init($desktopFile, $outputTsDir); } elsif ($cmd eq 'desktop2ts') { my ($desktopFile, $outputTsDir) = @ARGV; Desktop2TS($desktopFile, $outputTsDir); } elsif ( $cmd eq 'ts2desktop' ) { my ($desktopFile, $tsDir, $outputDesktopFile) = @ARGV; TS2Desktop($desktopFile, $tsDir, $outputDesktopFile); } else { printHelp(); } exit; } sub printHelp { my $bin = basename($0); print " Usage: init: $bin init \$desktopFile \$outputTsDir output source \$outputTsDir/desktop.ts and translation \$outputTsDir/desktop_.ts desktop -> ts: $bin desktop2ts \$desktopFile \$outputTsDir output source \$outputTsDir/desktop.ts ts -> desktop: $bin ts2desktop \$desktopFile \$tsDir \$outputDesktopFile document https://github.com/linuxdeepin/deepin-gettext-tools/blob/master/README.md " } sub Desktop2TS { my ($file, $outputTsDir) = @_; my $contextName = 'desktop'; my $desktopCfg = Config::Tiny->read($file, 'utf8'); my $dom = createDocument(); my $root = $dom->documentElement; my $context = getEmptyContext($dom, $contextName); my @msgs = createDesktopTsMessages($dom, $desktopCfg); $context->appendChild($_) for @msgs; # source make_path($outputTsDir); my $outputTsFile = "$outputTsDir/desktop.ts"; say "output ts file: ", $outputTsFile; saveDocument($dom, $outputTsFile, 1); } sub Init { my ($file, $outputTsDir) = @_; my $contextName = 'desktop'; my $desktopCfg = Config::Tiny->read($file, 'utf8'); my $dom = createDocument(); my $root = $dom->documentElement; my $context = getEmptyContext($dom, $contextName); my @msgs = createDesktopTsMessages($dom, $desktopCfg); $context->appendChild($_) for @msgs; # source make_path($outputTsDir); saveDocument($dom, "$outputTsDir/desktop.ts", 1); # translations my @langs = getDesktopLangs($desktopCfg); for my $lang ( @langs ) { my $langDom = createDocument($lang); my $langRoot = $langDom->documentElement; my $langContext = getEmptyContext($langDom, $contextName); ## fill translation my $sourceContextCopy = $context->cloneNode(1); ### $sourceContextCopy my @msgs = $sourceContextCopy->findnodes('./message'); ### @msgs for my $msg (@msgs) { ### $msg my $translation = ($msg->findnodes('./translation[1]'))[0]; die "not found translation" unless $translation; ### $translation my @locations = $msg->findnodes('./location'); die "not found any location" unless @locations; for my $location (@locations) { my ($section, $key) = getSectionKeyWithLocationLang($location, $lang); my $value = $desktopCfg->{$section}{$key}; if (defined $value) { $translation->removeAttribute('type'); $translation->appendText($value); # NOTE: 如果一条msg中包含了多个location,则获取了第一条有用的翻译后跳出循环 last; } } } $langContext->appendChild($_) for @msgs; saveDocument($langDom, "$outputTsDir/desktop_$lang.ts", 1); } } sub TS2Desktop { my ($desktopFile, $tsDir, $outputDesktopFile) = @_; my $contextName = 'desktop'; my $desktopCfg = Config::Tiny->read($desktopFile, 'utf8'); updateDesktopTranslation($desktopCfg , $contextName, $tsDir); writeDesktop($desktopCfg, $outputDesktopFile); } sub getEmptyContext { my ($dom, $contextNameStr) = @_; my $root = $dom->documentElement; my $context = findContext($root, $contextNameStr); if ($context) { my @oldMsgs = $context->findnodes('./message'); $context->removeChild($_) for @oldMsgs; } else { # create context $context = createDesktopTsContext($dom, $contextNameStr); $root->appendChild($context); } return $context; } sub findContext { my ($root, $name) = @_; my @ctxNames = $root->findnodes('./context/name'); for my $ctxName (@ctxNames) { my $ctxNameText = $ctxName->textContent; if ( $ctxNameText eq $name ) { return $ctxName->parentNode; } } } sub createDocument { my ($lang) = @_; my $dom = XML::LibXML::Document->new('1.0', 'utf-8'); my $dtd = $dom->createInternalSubset('TS', undef, undef); # TS my $root = $dom->createElement('TS'); $root->setAttribute('version', '2.1'); if ($lang) { $root->setAttribute('language', $lang); } $dom->setDocumentElement($root); return $dom; } sub saveDocument { my ($dom, $file, $pretty) = @_; open FH, '>', $file or die "failed to open file $file for write: $!"; print FH $dom->toString; close FH; } sub createDesktopTsContext { my ($dom, $contextNameStr) = @_; my $context = $dom->createElement('context'); my $ctxName = $dom->createElement('name'); $ctxName->appendText($contextNameStr); $context->appendChild($ctxName); return $context; } sub createDesktopTsMessages { my ($dom, $desktopCfg) = @_; # key: source, value: [ section . key, ... ] my %sourceSectionKeyMap; for my $section ( sort keys %$desktopCfg ) { # skip root section if ($section eq '_') { next; } for my $key (@localeKeys) { my $source = $desktopCfg->{$section}{$key}; if ($source) { push @{ $sourceSectionKeyMap{$source} }, "$section]$key"; } } } ### %sourceSectionKeyMap my @msgs; for my $source (sort keys %sourceSectionKeyMap) { my $locations = $sourceSectionKeyMap{ $source }; my $msg = createDesktopTsMessage($dom, $source, $locations); push @msgs, $msg; } return @msgs; } sub createDesktopTsMessage { my ($dom, $_source, $_locations) = @_; my $message = $dom->createElement('message'); for my $_location (sort @$_locations ) { my $location = $dom->createElement('location'); $location->setAttribute('filename', $_location); $location->setAttribute('line', 0); $message->appendChild($location); } my $source = $dom->createElement('source'); $source->appendText($_source); $message->appendChild($source); my $translation = $dom->createElement('translation'); $translation->setAttribute('type', 'unfinished'); $message->appendChild($translation); return $message; } sub updateDesktopTranslation { my ($desktopCfg, $contextName, $tsDir) = @_; # remove locale keys for my $section (keys %$desktopCfg) { next if $section eq '_'; for my $key (keys %{ $desktopCfg->{$section} }) { if ($key =~ /\[\w+\]/) { warn "remove $section $key"; delete $desktopCfg->{$section}{$key}; } } } # read translation my @files = getTranslationFiles($tsDir); for my $file ( @files ) { warn "read ts file $file"; my $dom = XML::LibXML->load_xml(location => $file); my $root = $dom->documentElement; my $lang = $root->getAttribute('language'); unless ($lang) { warn "language unknown in file $file"; next; } my $context = findContext($root, $contextName); unless ($context) { warn "context not found in file $file"; next; } my @msgs = $context->findnodes('./message'); for my $msg (@msgs) { my $translation = ($msg->findnodes('./translation[1]'))[0]; die "not found translation" unless $translation; my @locations = $msg->findnodes('./location'); die "not found any location" unless @locations; for my $location ( @locations) { my $value = $translation->textContent; next unless $value; my ($section, $key) = getSectionKeyWithLocationLang($location , $lang); $desktopCfg->{$section}{$key} = $value; } } } } sub getTranslationFiles { my ($tsDir) = @_; glob "$tsDir/desktop_*.ts"; } sub getDesktopLangs { my %langMap; my ($desktopCfg) = @_; for my $section (keys %$desktopCfg) { # skip root section next if $section eq '_'; my $localeKeysJoined = join '|', @localeKeys; my $regex = qr/(?:$localeKeysJoined)\[(\w+)\]/; for my $key (keys %{ $desktopCfg->{$section} }) { ### $key if ( $key =~ $regex ) { my $lang = $1; $langMap{ $lang } = 1; } } } return keys %langMap; } sub getSectionKeyWithLocationLang { my ($location, $lang) = @_; my $filename = $location->getAttribute('filename'); my ($section, $key) = split /\]/, $filename, 2; $key = $key."[$lang]"; return $section, $key; } sub writeDesktop { my ($desktopCfg, $file) = @_; open my $fh, '>:utf8', $file or die $!; printDesktop($fh, $desktopCfg); close $fh; } sub printDesktop { my ($fh, $desktopCfg) = @_; my @sections = grep { $_ ne '_' } sort keys %$desktopCfg; my @sortedSections = ('Desktop Entry'); # fill translation for (@sections) { push @sortedSections, $_ if $_ ne 'Desktop Entry'; } ### @sortedSections for my $section ( @sortedSections ) { say $fh "[$section]"; my $sectionHash = $desktopCfg->{$section}; my (@noTsKeys, @tsKeys); for (sort keys %$sectionHash) { if (/\[\w+\]/) { push @tsKeys, $_; } else { push @noTsKeys, $_; } } printSectionKeys($fh, $sectionHash, \@noTsKeys); if (@tsKeys) { say $fh "\n# Translations:\n# Do not manually modify!"; printSectionKeys($fh, $sectionHash, \@tsKeys); } print $fh "\n"; } } sub printSectionKeys { my ($fh, $sectionHash, $keys) = @_; for my $key ( @$keys ) { my $value = $sectionHash->{$key}; $value =~ s/\n/ /g; say $fh "$key=$value" if $value; } } deepin-gettext-tools-1.0.11/src/example_config.ini000066400000000000000000000001451457676144100221450ustar00rootroot00000000000000[locale] langs=["zh_CN","zh_TW"] locale_dir=../locale project_name=dde-control-center source_dir=../ deepin-gettext-tools-1.0.11/src/generate_mo.py000077500000000000000000000050251457676144100213300ustar00rootroot00000000000000#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2015 Deepin Technology Co., Ltd. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import subprocess import os import sys import argparse try: from configparser import RawConfigParser as ConfigParser except ImportError: from ConfigParser import RawConfigParser as ConfigParser def main(args): # Read config options. config_path = args.file copy = args.copy config_parser = ConfigParser() config_parser.read(config_path) config_dir = os.path.dirname(os.path.realpath(config_path)) os.chdir(config_dir) project_name = config_parser.get("locale", "project_name") locale_dir = os.path.abspath(config_parser.get("locale", "locale_dir")) mo_locale_dir = os.path.join(locale_dir, "mo") for f in os.listdir(locale_dir): lang, ext = os.path.splitext(f) if ext == ".po": mo_dir = os.path.join(mo_locale_dir, lang, "LC_MESSAGES") mo_path = os.path.join(mo_dir, "%s.mo" % project_name) po_path = os.path.join(locale_dir, f) subprocess.call( "mkdir -p %s" % mo_dir, shell=True ) subprocess.check_call( "msgfmt -o %s %s" % (mo_path, po_path), shell=True ) if copy: subprocess.call( "sudo cp -r %s %s" % ( os.path.join(mo_locale_dir, lang), "/usr/share/locale/"), shell=True ) return 0 def valid_path(string): """ check if the path entered is a valid one """ if not os.path.isfile(string): msg = "%s is not a valid file" % string raise argparse.ArgumentTypeError(msg) return string if __name__ == "__main__": parser = argparse.ArgumentParser( description='Scan po files and generate mo files according to the ini config file', epilog='A mo folder will be generated in the locale directory') parser.add_argument('file',metavar='file', type=valid_path, help='A valid ini config path, full or local.') parser.add_argument('--copy', dest='copy', action='store_true', help='Execute "sudo cp *.mo /usr/share/locale"') args = parser.parse_args() sys.exit(main(args)) deepin-gettext-tools-1.0.11/src/policy_ts_convert.py000077500000000000000000000174321457676144100226150ustar00rootroot00000000000000#!/usr/bin/env python3 # Copyright (C) 2017 Deepin Technology Co., Ltd. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import xml.etree.ElementTree as ET import sys import os from glob import glob # const attr_xml_lang = "{http://www.w3.org/XML/1998/namespace}lang" class Action: #msgs dict #descs dict #msg_src string #desc_src string def __init__(self, action_elem): self.id = action_elem.get("id") self.msgs = {} self.descs = {} for item in action_elem: if item.tag == "message": lang = item.get(attr_xml_lang) if lang is None: self.msg_src = item.text else: self.msgs[lang] = item.text if item.tag == "description": lang = item.get(attr_xml_lang) if lang is None: self.desc_src = item.text else: self.descs[lang] = item.text def get_desc_src(self): if hasattr(self, "desc_src"): return create_ts_msg(self.desc_src, None, self.id, "description") return None def get_msg_src(self): return create_ts_msg(self.msg_src, None, self.id, "message") def get_desc(self, lang): desc = self.descs.get(lang) return create_ts_msg(self.desc_src, desc, self.id, "description") def get_msg(self, lang): msg = self.msgs.get(lang) return create_ts_msg(self.msg_src, msg, self.id, "message") def get_langs(self): # return msgs and descs keys langs = {} for k in self.msgs: langs[k] = 1 for k in self.descs: langs[k] = 1 return langs.keys() def policy2ts(policyFile, outputTsDir): print("policyFile:", policyFile) os.makedirs(outputTsDir, exist_ok=True) actions = [] tree = ET.parse(policyFile) for action_elem in tree.iter("action"): action = Action(action_elem) actions.append(action) if len(actions) == 0: return ts, ctx = create_ts_doc() for action in actions: ctx.append(action.get_msg_src()) if action.get_desc_src(): ctx.append(action.get_desc_src()) outputTsFile = outputTsDir + "/policy.ts" print("outputTsFile:", outputTsFile) write_ts(ts, outputTsFile) def init(policyFile, outputTsDir): print("policyFile:", policyFile) print("outputTsDir:", outputTsDir) os.makedirs(outputTsDir, exist_ok=True) actions = [] tree = ET.parse(policyFile) for action_elem in tree.iter("action"): action = Action(action_elem) actions.append(action) if len(actions) == 0: return ts, ctx = create_ts_doc() langs = {} for action in actions: ctx.append(action.get_msg_src()) ctx.append(action.get_desc_src()) l = action.get_langs() for k in l: langs[k] = 1 write_ts(ts, outputTsDir + "/policy.ts") print(langs.keys()) for lang in langs.keys(): ts, ctx = create_ts_doc() ts.set("language", lang) for action in actions: ctx.append(action.get_msg(lang)) ctx.append(action.get_desc(lang)) write_ts(ts, outputTsDir + "/policy_" + lang +".ts") def ts2policy(policyFile, tsDir, outputPolicyFile): print("policyFile:", policyFile) print("tsDir:", tsDir) print("outputPolicyFile:", outputPolicyFile) # load ts files ts_files = glob(tsDir + "/policy_*.ts") tr_dict = {} # print("ts_files:", ts_files) for filename in ts_files: lang, msgs = load_tr(filename) tr_dict[lang] = msgs tree = ET.parse(policyFile) remove_list = [] for action_elem in tree.iter("action"): for item in action_elem: if item.tag == "message" or item.tag == "description": lang = item.get(attr_xml_lang) if lang is not None: remove_list.append((action_elem, item)) for i in remove_list: i[0].remove(i[1]) for action_elem in tree.iter("action"): action = Action(action_elem) for lang in sorted(tr_dict): d = tr_dict[lang] src = "" for ty in ["description", "message"]: if ty == "message": src = action.msg_src else: src = action.desc_src if hasattr(action, 'desc_src') else None val = d.get(action.id + "!" + ty) if val != None: source = val[0] translation = val[1] if source == src and translation != "" and translation is not None: msg = ET.SubElement(action_elem, ty) msg.set("xml:lang", lang) msg.text = translation write_policy(tree.getroot(), outputPolicyFile) def load_tr(tsFile): tree = ET.parse(tsFile) root = tree.getroot() lang = root.get("language") msgs = root.findall("./context/message") msgs_dict = {} for msg in msgs: source = msg.find("./source").text translation = msg.find("./translation").text key = msg.find("./location").get("filename") msgs_dict[key] = (source,translation) return lang, msgs_dict def create_ts_doc(): ts = ET.Element("TS") ts.set("version", "2.1") context = ET.SubElement(ts, "context") ctx_name = ET.SubElement(context, "name") ctx_name.text = "policy" return ts, context def create_ts_msg(src, translation, action_id, ty): msg = ET.Element("message") location = ET.SubElement(msg, "location") location.set("filename", action_id + "!" + ty) location.set("line", "0") source = ET.SubElement(msg, "source") source.text = src tr = ET.SubElement(msg, "translation") if translation is None: tr.set("type", "unfinished") else: tr.text = translation return msg def indent(elem, level=0, more_sibs=False): i = "\n" if level: i += (level-1) * "\t" num_kids = len(elem) if num_kids: if not elem.text or not elem.text.strip(): elem.text = i + "\t" if level: elem.text += "\t" count = 0 for kid in elem: indent(kid, level+1, count < num_kids - 1) count += 1 if not elem.tail or not elem.tail.strip(): elem.tail = i if more_sibs: elem.tail += "\t" else: if level and (not elem.tail or not elem.tail.strip()): elem.tail = i if more_sibs: elem.tail += "\t" def write_xml(root, filename, header): indent(root) content = ET.tostring(root, encoding="unicode") with open(filename, 'w', encoding="utf-8") as f: f.write(header) f.write(content) def write_ts(root, filename): header = ''' ''' write_xml(root, filename, header) def write_policy(root, filename): header = ''' ''' write_xml(root, filename, header) argv = sys.argv if len(argv) == 4 and argv[1] == "policy2ts": policy2ts(argv[2], argv[3]) elif len(argv) == 4 and argv[1] == "init": init(argv[2], argv[3]) elif len(argv) == 5 and argv[1] == "ts2policy": ts2policy(argv[2], argv[3], argv[4]) else: # print usage print(''' init policyFile outputTsDir policy2ts policyFile outputTsDir ts2policy policyFile tsDir outputPolicyFile ''') deepin-gettext-tools-1.0.11/src/update_pot.py000077500000000000000000000054431457676144100212130ustar00rootroot00000000000000#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2015 Deepin Technology Co., Ltd. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import argparse import os import re import subprocess try: from configparser import RawConfigParser as ConfigParser except ImportError: from ConfigParser import RawConfigParser as ConfigParser def update_pot(config_path): # Read config options. config_parser = ConfigParser() config_parser.read(config_path) config_dir = os.path.dirname(os.path.realpath(config_path)) os.chdir(config_dir) project_name = config_parser.get("locale", "project_name") # Source dirs are separated by blank chars source_dirs = re.split('\s+', config_parser.get("locale", "source_dir")) locale_dir = os.path.abspath(config_parser.get("locale", "locale_dir")) if not os.path.exists(locale_dir): os.makedirs(locale_dir) pot_filepath = os.path.join(locale_dir, project_name + ".pot") if os.path.exists(pot_filepath): os.remove(pot_filepath) py_source_files = [] go_source_files = [] for source_dir in source_dirs: for root, dirs, files in os.walk(source_dir): for f in files: if f.startswith("."): continue if f.endswith(".py"): py_source_files.append(os.path.join(root, f)) elif f.endswith(".go"): go_source_files.append(os.path.join(root, f)) if len(py_source_files) > 0: gen_pot(pot_filepath, ['-k_'], py_source_files) if len(go_source_files) > 0: gen_pot(pot_filepath, ['-kTr', '-C', '--from-code=utf-8'], go_source_files) def gen_pot(output, args, source_files): callargs = ['xgettext', '-F', '-o', output] if os.path.exists(output): # join messages with existing file callargs.append('-j') callargs.extend(args) #print callargs callargs.extend(source_files) subprocess.call(callargs) def valid_path(string): """ check if the path entered is a valid one """ if not os.path.isfile(string): msg = "%s is not a valid file" % string raise argparse.ArgumentTypeError(msg) return string if __name__ == "__main__": parser = argparse.ArgumentParser( description='Scan msgid and generate pot file according to the ini config file', epilog='A domain.pot file will be generated in the locale directory') parser.add_argument('file',metavar='file', type=valid_path, help='A valid ini config path, full or local.') args = parser.parse_args() update_pot(args.file)