weblate | Web based localization tool with tight version control | Internationalization library

 by   WeblateOrg Python Version: 5.5 License: GPL-3.0

kandi X-RAY | weblate Summary

kandi X-RAY | weblate Summary

weblate is a Python library typically used in Utilities, Internationalization applications. weblate has no bugs, it has build file available, it has a Strong Copyleft License and it has high support. However weblate has 1 vulnerabilities. You can install using 'pip install weblate' or download it from GitHub, PyPI.

Web based localization tool with tight version control integration.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              weblate has a highly active ecosystem.
              It has 3634 star(s) with 841 fork(s). There are 89 watchers for this library.
              There were 9 major release(s) in the last 6 months.
              There are 384 open issues and 4355 have been closed. On average issues are closed in 404 days. There are 15 open pull requests and 0 closed requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of weblate is 5.5

            kandi-Quality Quality

              weblate has 0 bugs and 0 code smells.

            kandi-Security Security

              weblate has 1 vulnerability issues reported (0 critical, 1 high, 0 medium, 0 low).
              weblate code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              weblate is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              weblate releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              It has 110877 lines of code, 6090 functions and 1037 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed weblate and discovered the below as its top functions. This is intended to give you an instant insight into weblate implemented functionality, and help decide if they suit your requirements.
            • Creates the translation .
            • Performs translation .
            • Updates a translation from a unit .
            • Check to see if the file revision has changed .
            • Gets the counts for a given project .
            • Bulk edit for the given unit_state
            • Handles a service request .
            • Discover available services .
            • Gets the other units .
            • Show a project .
            Get all kandi verified functions for this library.

            weblate Key Features

            No Key Features are available at this moment for weblate.

            weblate Examples and Code Snippets

            Nitrokey's User Documentation,Solving Merge Conflicts
            CSSdot img1Lines of Code : 14dot img1no licencesLicense : No License
            copy iconCopy
            git remote add weblate https://$USERNAME:$APIKEY@translate.nitrokey.com/git/nitrokey-documentation/index/
            
            git remote update weblate
            git merge weblate/master
             Auto-merging locales/de/LC_MESSAGES/x230.po
             CONFLICT (content): Merge conflict in locales/  
            Bambam,Usage,Installation
            Pythondot img2Lines of Code : 7dot img2License : Strong Copyleft (GPL-3.0)
            copy iconCopy
            sudo apt install bambam
            man bambam
            bambam
            
            cd bambam-1.1.2
            
            ./bambam.py
            
            quit
            
            man ./bambam.6
              
            Miscellaneous,Developer info
            Pythondot img3Lines of Code : 3dot img3License : Strong Copyleft (AGPL-3.0)
            copy iconCopy
            sudo yunohost app install https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug
            or
            sudo yunohost app upgrade weblate -u https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug
              
            cannot extract json items on webpage using scrapy
            Pythondot img4Lines of Code : 22dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            data_obj = json.loads(re.search(r'window\._initialData\=(\{.+\});', script_text).group(1))
            
            > data_obj['jobLocation']
            
            Arlington, TX 
            
            > data_obj['localeData'][''][-1].split('\n')
            
            ['Pr
            Invalid regular expression: invalid escape \ sequence, Postgres, Django
            Pythondot img5Lines of Code : 3dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            >>> print re.escape('яблуко*')
            \я\б\л\у\к\о\*
            

            Community Discussions

            QUESTION

            xgettext dry run to avoid unnecessary commits in Github workflow
            Asked 2022-Jan-26 at 15:32

            Is there any way to do a dry run of xgettext on source files, in order to simply check if there are any differences compared to the current .pot file?

            I have set up a Github workflow that will run xgettext on source files any time a change to a source file is pushed to the repository. The result is that often the change to the source file didn't change the translation strings, so the only difference in the resulting .pot file is the Creation date, which gets updated every time xgettext is run. This makes for unnecessary commits, and triggers unnecessary webhook calls to my weblate instance which picks up on an "updated" .pot file, and winds up generating its own Pull Request with an "updated" .pot file.

            If there were a way to do a dry run and first check if there are any actual differences in the strings, I could avoid unnecessary commits and PRs from polluting my repo. Any ideas?

            ...

            ANSWER

            Answered 2022-Jan-23 at 15:03

            I was able to add a filter to my Github workflow, checking whether there are any significant changes besides a simple update to the value of POT-Creation-Date in the .pot file. I added an id to the step that takes care of running xgettext, then after running xgettext I save the count of significant lines changed in the pot file to a variable that will be accessible to the next step:

            Source https://stackoverflow.com/questions/70797916

            QUESTION

            How to add required permission for Weblate REST translations file upload?
            Asked 2021-Dec-09 at 13:36

            I'm scripting a Weblate (version 4.3.2) installation and I've successfully fetched existing localizations from Weblate REST API using curl and pass the Authorization Token value from the Weblate profile settings (login, open profile menu from top right, select Settings - API Access and copy-paste the "personal API key").

            In short, the GET /api/translations/(string:project)/(string:component)/(string:language)/file/ request works according to documentation at https://docs.weblate.org/en/weblate-4.3.2/api.html#get--api-translations-(string-project)-(string-component)-(string-language)-file- and I'm getting the expected results with pretty good performance.

            However, the POST /api/translations/(string:project)/(string:component)/(string:language)/file/ request documented at https://docs.weblate.org/en/weblate-4.3.2/api.html#post--api-translations-(string-project)-(string-component)-(string-language)-file- always fails and results in following response:

            ...

            ANSWER

            Answered 2021-Dec-09 at 13:36

            Most likely method or conflicts parameters are wrong. The API code raises permission error in these cases, but it should rather tell user what is wrong.

            The error messages should be more useful in the next release, I've improved this in https://github.com/WeblateOrg/weblate/commit/4abf2193ed57cb7822db804376c6adde9cccb753

            Source https://stackoverflow.com/questions/70263301

            QUESTION

            How to integrate a git submodule to a git workflow
            Asked 2021-Sep-14 at 07:05

            Here's my situation : my team and I have a project using a front end framework. It works great and is correctly organized with a typical git workflow with master, develop and features/fixes branches.

            We now have an increasing need to add a large number of translations to our project (translations are located in a single folder). We decided to try out Weblate to manage them. Right now, Weblate has a full access to our entire git repository to push translations.

            For security reasons, we want Weblate to only have access to our translation folder. We thought we could create a git submodule for the translation and give weblate an access to it.

            Unfortunately, I am not sure of how we could easily integrate a submodule to our current workflow.

            I thought of a solution but I am not sure it is possible : I want to create a submodule with a workflow similar to the main project. When a developer (or weblate) wants to update a translation, he has to create a feature branch on both the main project and the submodule and then merge both branch when the feature is finished.

            I am not familiar with git submodules and there is probably a smarter way to do this so your thoughts on this would be very much appreciated :)

            ...

            ANSWER

            Answered 2021-Sep-14 at 07:04

            The simplest approach would be to reference in your main project the translation folder/submodule, set to follow the latest commit from its main branch.

            That means at any point in your main repository, a git submodule update --remote will update the submodule to its latest commit.

            That way, you can have a pull-request/merge policy within your separate translation repository, and, once reviewed and merged in its main branch, a submodule update --remote in the main repository will get the latest revision of that submodule.

            Source https://stackoverflow.com/questions/69169897

            QUESTION

            How to tell Weblate that a particular string is a plural one
            Asked 2021-Aug-20 at 05:36

            I'm using ini file for localisation. Actually almost the Joomla! format. I searched the Weblate documentation and read all about Gettext plural formulas for different languages. What I can't find is how to "tell" Weblate that a particular string id is a plural. I basically extended the ini to include something like this:

            ...

            ANSWER

            Answered 2021-Aug-20 at 05:36

            The file format has to support plurals. The capabilities of supported formats are documented in https://docs.weblate.org/en/latest/formats.html#translation-types-capabilities

            If you are inventing the own way of storing plurals, you would have to implement support for it in Weblate as well. Or just choose one of existing formats which are widely used.

            Source https://stackoverflow.com/questions/68846143

            QUESTION

            XSLT - Translate strings using key() lookup
            Asked 2021-Jul-30 at 08:25

            I'm trying to solve a problem, where I have to translate strings using xslt.

            I saw this: XSLT key() lookup and this: XSLT Conditional Lookup Table

            but I'm not able to get it to work. I've tried to come up with the minimal example below which shows the problems that I'm facing. The "real" xsl is assembled from code snippets using a build process. This involves some constraints.

            The inner structure of the translation lookup tables always is the same, since they are downloaded from a translation tool in flat xml format http://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/flatxml.html. I can only wrap them into distinct parent nodes which is what i tried using the "lu" namespace. The translation tables for all languages have to be stored inside the xsl, because different generations of xsl with different translations may exist next to each other. So no "sidecar" files.

            Until now I can't get the key to work. The output of xsltproc is the following:

            ...

            ANSWER

            Answered 2021-Jul-30 at 08:25

            There are two mistakes in your XSLT stylesheet that immediately jump out:

            1. The xsl:key element is allowed only at the top level, as a child of the xsl:stylesheet element.
            2. In XSLT 1.0, keys operate only on the current document. If you want to lookup from the stylesheet itself, you must change the context to the stylesheet document before calling the key() function. Here are two examples: https://stackoverflow.com/a/32440143/3016153
              https://stackoverflow.com/a/30188334/3016153

            I am afraid that's about all that can be said without a reproducible example.

            --- added ---

            So this means that I can't selectively define a key depending on language?

            You cannot define a key conditionally - but you can define more than one key and select the one to use based on the specified language. Here's a simplified example:

            XSLT 1.0

            Source https://stackoverflow.com/questions/68577164

            QUESTION

            How to solve permission problems when using GitLab CI Runner with Docker and non-root user?
            Asked 2020-Nov-24 at 13:32

            I am using a GitLab CI Runner with Docker.

            My dockerfile looks as follows:

            ...

            ANSWER

            Answered 2020-Nov-24 at 13:32

            I finally solved the issue through:

            • Removing USER ciuser from the Dockerfile so that the runner is starting with the root user again
            • Changing the test command as follows sudo -H -u ciuser bash -c "npm install && npm run test:cobertura" so that it is executed by the ciuser as it is described in this post.

            Source https://stackoverflow.com/questions/64983984

            QUESTION

            Why doesn't weblate recognize my pot file?
            Asked 2020-Aug-07 at 08:50

            I'm using a hosted weblate.

            I'm in the "Files" section of my component configuration. Below is my setup.

            Translation files:

            • File format: gettext PO file
            • Filemask: src/translations/*.po
            • Language filter: ^[^.]+$

            Monolingual translations:

            • All fields empty
            • Edit base file checked

            Adding new languages:

            • Template for new translations: src/translations/template.pot
            • Adding new translation: Create new language file
            • Language code style: Default based on the file format

            I can't validate these settings, I have an error below fields "Template for new translations" and "Adding new translation": The error is "Unrecognized base file for new translations".

            I'm am 100% sure the pot file exists on the branch weblate is configured to use and also on master and that the path is correct.

            Here are the first few lines of the pot file:

            ...

            ANSWER

            Answered 2020-Aug-05 at 15:36

            The header of the file seems stripped. At least you should prepend following to make it syntactically valid:

            Source https://stackoverflow.com/questions/63261151

            QUESTION

            Adding translation strings for iOS in Weblate failes for the 1st commit
            Asked 2020-Jul-10 at 05:48

            Everytime we add a new translation string in Weblate via Web-GUI the iOS string is without quotes.

            drawer_collect_enroll_i=Select what you want

            but it should be

            "drawer_collect_enroll_i"="Select what you want"

            If I commit a 2nd time everything is corrected!!

            Any solutions for this?

            ...

            ANSWER

            Answered 2020-Jul-10 at 05:48

            You've also reported it at https://github.com/WeblateOrg/weblate/issues/4151, let's deal with the bug there...

            Source https://stackoverflow.com/questions/62817700

            QUESTION

            How can I limit a Weblate check/autofix on the file format (i.a. Android, iOS)
            Asked 2020-Jun-07 at 07:56

            We use Weblate in our mobile app CI environment. So far everything is awesome. Weblate runs in a docker environment (v4.1)

            Now I want to improve the workflow.

            I managed to create custom checks, these validate the use of Android/iOS placeholders (see sample below). Now the translator needs to know which platform he is working with to use the correct placeholder and dismiss the false-positive check.

            Placeholder in use right now are %1$@ for iOS and %1$s for Android

            My question:

            • Is there a better/general approach how I can teach my translators how to write placeholders?
            • How can I write my check based on the file format (or translation file suffix, i.e .xml, .strings)? So I know, this is an android/xml file, and the placeholder should be %1$s NOT %1$@

            Sample check

            ...

            ANSWER

            Answered 2020-Jun-07 at 07:56

            I can see few approaches:

            • In case these formats are generic to the file format, file a feature request so that it's included in future Weblate releases
            • In case this affects just few strings, you can define the placeholders, you can utilize generic placeholders check in Weblate and let Weblate check and highlight them
            • To limit check triggering only on some components, you can use translation flags, these can be set at component level
            • In case you want to write custom check, it should probably also check if the format string is present in the source string, so something like:

            Source https://stackoverflow.com/questions/62214736

            QUESTION

            Best way to edit source strings in Weblate
            Asked 2020-Feb-03 at 09:11

            In Weblate I find myself unable to edit the source strings in the GUI, because they are flagged as "read only". I imagine that a manual way would be to manually edit the source files and push them up, outside of Weblate. But that requires some understanding of the chosen format (gettext in my case).

            Is there any way to do this in the GUI? I would prefer some way that propagates the change across all the languages.

            ...

            ANSWER

            Answered 2020-Feb-03 at 09:11

            Currently, there is no way to do this inside Weblate for bilingual translation files. In these, the strings are extracted from the source code while doing some transformations (in your case using xgettext), so editing the source code is not a task that would be easy to automate inside Weblate.

            Source https://stackoverflow.com/questions/60031270

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install weblate

            You can install using 'pip install weblate' or download it from GitHub, PyPI.
            You can use weblate like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install Weblate

          • CLONE
          • HTTPS

            https://github.com/WeblateOrg/weblate.git

          • CLI

            gh repo clone WeblateOrg/weblate

          • sshUrl

            git@github.com:WeblateOrg/weblate.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Internationalization Libraries

            formatjs

            by formatjs

            react-i18next

            by i18next

            version

            by sebastianbergmann

            globalize

            by globalizejs

            angular-translate

            by angular-translate

            Try Top Libraries by WeblateOrg

            docker

            by WeblateOrgShell

            docker-compose

            by WeblateOrgShell

            website

            by WeblateOrgPython

            wlc

            by WeblateOrgPython

            translation-finder

            by WeblateOrgPython