translate-tool | Support multiple tools for translation at the same time
kandi X-RAY | translate-tool Summary
kandi X-RAY | translate-tool Summary
Support multiple tools for translation at the same time
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- bundle translation functions
- Makes a text transfer of a text .
- translate a
- Translate a language to the state .
- Translate a request
- translate text from source text
- map states to props
- Check if build process exists .
- Increment action counter .
- Outputs result update an result
translate-tool Key Features
translate-tool Examples and Code Snippets
Community Discussions
Trending Discussions on translate-tool
QUESTION
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:25There are two mistakes in your XSLT stylesheet that immediately jump out:
- The
xsl:key
element is allowed only at the top level, as a child of thexsl:stylesheet
element. - 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
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install translate-tool
Note: requires a node version >= 7 and an npm version >= 4.
If you have installation or compilation issues with this project, please see our debugging guide
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page