spirit-po | localization using GNU gettext po files , based on boost | Internationalization library

 by   garbageslam C++ Version: v1.1.2 License: BSL-1.0

kandi X-RAY | spirit-po Summary

kandi X-RAY | spirit-po Summary

spirit-po is a C++ library typically used in Utilities, Internationalization applications. spirit-po has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A C++ library for localization using GNU gettext po files, based on boost spirit
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spirit-po has a low active ecosystem.
              It has 33 star(s) with 7 fork(s). There are 6 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 5 have been closed. On average issues are closed in 21 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of spirit-po is v1.1.2

            kandi-Quality Quality

              spirit-po has 0 bugs and 0 code smells.

            kandi-Security Security

              spirit-po has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spirit-po code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spirit-po is licensed under the BSL-1.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              spirit-po releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of spirit-po
            Get all kandi verified functions for this library.

            spirit-po Key Features

            No Key Features are available at this moment for spirit-po.

            spirit-po Examples and Code Snippets

            No Code Snippets are available at this moment for spirit-po.

            Community Discussions

            QUESTION

            Why is my generated precompiled file so big when using a boost based library?
            Asked 2021-Jan-18 at 08:24

            I'm working on a project using libraries handled through vcpkg. As compile time wasn't that great, I did some headers clean up and configured the project to use precompiled headers, putting STL and vcpkg headers inside.

            I started to run into the infamous C1076, C3859 and C1060 errors, and a quick check to the generated pch showed me a massive 1.2GB file ...

            I ran a build using the /showIncludes switch, and it appears that spirit-po, a Boost based library that I use for translations, references more than 2600 Boost headers. (My project just has 70 files, with nothing fancy) It's the only Boost based library used in the project.

            Just to be sure this was the culprit, I removed everything but the spirit-po files from the pch :

            ...

            ANSWER

            Answered 2021-Jan-16 at 17:49
            1. Header only libraries work because there are no details left out of those headers.

            2. Precompiled headers contain all the compiled information of the headers before start of the translation unit.

            3. A large part (the majority) of boost libraries are header only. To add insult to injury, they're highly generic meaning there will be many templates and their instantiations.

            1 + 2 + 3 are the perfect storm. If the size is a concern, your better bet is to shield boost from your headers and include them in the select translation units that actively depend on them.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install spirit-po

            To begin, first obtain some .po files. PO files are created by translators, they contain a dictionary of translated strings. For examples from various GNU projects, see our test folder. Then, load the file and construct a spirit_po::catalog from it. The catalog object serves translation requests using the strings it loaded from the PO file. the translated form of "Hello world!" will be displayed. The result will be a const char * pointing to a string owned by the catalog. (Or, if the translation misses becaues this string wasn't in the catalog, it will simply return the english text "Hello world!", the same pointer it was passed in.). a string is translated, and also marked with a context string. Sometimes the same english phrase or sentence appears in your program in multiple places, but should be translated differently depending on context. The context string allows you to provide a hint to the translator and allows the program to disambiguate the two usages. (This particular example is unfortunately a poor one.). the catalog object will look up the C-format string in the catalog, and search for the plural form corresponding to number. This ensures that "shots" will be pluralized correctly no matter what language is used. (In many languages, there are more than two plural forms and language-specific logic is needed to determine the appropriate form to use based on the number. The translator provides this logic in the po-file header.) Then we use printf to substitute the numbers into the string. These examples are actually all rehash from gettext documentation -- the member functions gettext, pgettext, ngettext are all analogous to calls to the C library libintl. If you aren't already familiar with gettext, have a look at their documentation. Note: It is standard in gettext documentation examples to use functions like printf with translated strings, since it is a C library. However, if you are working in C++, you might be better off to use a type-safe alternative to printf. Otherwise, if the translator makes a mistake, or an adversary modifies the po files, you can get undefined behavior in your program with code like above. You might prefer to use something like tinyformat for instance.

            Support

            spirit-po has been tested with. See .travis.yml and appveyor.yml for info about our CI.
            Find more information at:

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

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/garbageslam/spirit-po.git

          • CLI

            gh repo clone garbageslam/spirit-po

          • sshUrl

            git@github.com:garbageslam/spirit-po.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 garbageslam

            visit_struct

            by garbageslamC++

            strict-variant

            by garbageslamC++

            cegui-emscripten

            by garbageslamC

            lua-primer

            by garbageslamC

            mingw-w64-gcc-linux

            by garbageslamShell