Blog Posts BPMN DMN

Kogito Tooling i18n update

Blog: Drools & jBPM Blog

With our previous release, we’ve introduced a new feature to our i18n library. When we first came up with this library we thought about a simple approach. A typesafe i18n library, and if it’s necessary a text modifier, we just need to wrap them with simple HTML tags, for example <b> and <i>, and use the I18nHtml component to render it.

This wasn’t sufficient for more complex cases, so we created the I18nWrapped component. This enables you to wrap any component of your choice! The best part is that it uses TypeScript to ensure that you’re doing everything correctly.

Let’s see how it works.

Firstly we’ve created a new function called wrapped(componentName: string): Wrapped<componentName>. It tells the name of the components that can be used on the I18nWrapped component props.

Secondly, we’ve changed our ReferenceDictionary type to be able to add these newly wrapped components into your dictionary.

On your dictionary type and in our en dictionary:

View the code on Gist.

And finally, you can use it by simply setting the dragFile as the children of the I18nWrapped component. This will infer the type of the components prop and will show the required properties as informed in your dictionary.

View the code on Gist.

That is it for this quick update! You can start using your custom components with the i18n lib in a typesafe way.

Thanks for reading, and stay tuned for more updates!


Kogito Tooling i18n update was originally published in kie-tooling on Medium, where people are continuing the conversation by highlighting and responding to this story.

The post Kogito Tooling i18n update appeared first on KIE Community.

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/kogito-tooling-i18n-update/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×