How to enable badge CSS classes in Vaadin 14.7.x when not using custom theme? - vaadin-flow

From the documentation:
The Badge-specific CSS classes are available as part of the Lumo
theme. To use these classes in your application, enable them in your
theme’s theme.json
And Lumo Badges describes how:
#JsModule("#vaadin/vaadin-lumo-styles/badge.js")
// Here, we add the style sheet to the global scope
#CssImport(include = "lumo-badge")
However, this does not work (CssImport also requires a value). What should this value be? Where can i find these ccs-files in my Vaadin project?

The easies way is to use Badge add-on from the Directory. It gives you easy to use Java API for Lumo badges. You can also look via links the GitHub repo how it has been implemented.

Related

Is it possible and advisable to use Antora's UI customization to generate a Google Sheets-like help widget?

I would like to use Antora to create a Google Sheet-like widget on a web app written in React. I wanted to see if the recommended approach is to write this in React or to utilize Antora's UI customization capabilities.
I have not tried to prototype either of these approaches yet.
Antora is a static site generator (SSG), so that's overkill for your use case and would add unnecessary complexity.
Antora documentation is authored in Asciidoc. Instead of using Antora, you can use asciidoctor to transform Asciidoc->HTML. There is asciidoctor.js, which is transpiled from the asciidoctor Ruby source, and that would be a good fit for a React app.

Is it possible to trigger "Set my default styles" with the Google Docs API?

I'm trying to trigger this action with the API: Format > Paragraph styles > Options > Use my default styles.
Is this possible?
Unfortunately, at the moment of this answer it is not possible on the Google Docs API to set the document styles to your saved default styles.
Workaround
However, as a possible workaround to this, you could use a batch request to update your document style with a default saved style on your script (or update the paragraph style, table style, etc).
If you want to ask for this functionality you can create a feature request here.

NopCommerce Plugin Localization

I am working on a NopCommerce website and have quite a bit of site-wide customization so I have created a plugin to handle it all but not sure on how to handle the localization. I see there are a couple of ways of updating the Localization strings, one way I have found is in the Plugin's Install() method:
this.AddOrUpdatePluginLocaleResource("Plugins.Payments.PayPalStandard.Fields.AdditionalFee", "Additional fee");
This looks like it only adds new resource strings for the plugin, is there a similar way to update the other resources via the Install() method like:
Admin.Catalog.Products.List.DownloadPDF
I found that there is a way to export the entire language to a language_pack.xml file, would it be better to just create an entire language pack instead? Is there a way to add a new language pack from the plugins Install() method?
I guess I could simply open the language_pack.xml file and add each resource found using the AddOrUpdatePluginLocaleResource, I was hoping that there was a built-in way of doing this using NopCommernce functionality.
Thanks!
As #Raphael suggested in a comment, provide a language pack along with plugin file to the end users, and give an option to upload required resource file within your plugin configuration page.
As per as I know, there is no inbuilt way to add language pack on plugin installation, but you can do some code on plugin install method to find language pack file(s) from plugin folder and install it, not quite sure, you can take reference of inbuilt methods.

Translate JMeter menu items

About Translate JMeter projects,
I follow the translating steps and open I18NEdit,
I see the translation text options but I notice that I can't localize Menu items as File, Exit,..
It seems that there are texts (messages.properties) that can't be localized.
Is messages.properties localization is done manually by adding messages_[locale].properties?
Am I missing something ? Is it on purpose or should an enhancement be opened?
We don't really use i18nedit for translation. But you can still use it.
Anyway, Internationalization in JMeter is based on properties files:
src/core/org/apache/jmeter/resources/messages_[locale].properties
src/components/..../*.properties (except some like colors.properties)
src/protocol/..../*.properties
No need to translate deprecated components.
The 2 latter are related to components that rely on TestBean approach (no specific GUI)
Note that a PR (github mirror) is preferred over a patch:
https://github.com/apache/jmeter/blob/trunk/CONTRIBUTING.md

Can I change a config value in firefox with an addon?

How is it possible to program an Addon that changes a certain config value in Firefox, that usually is only accessible via about:config?
Is there a template I could use? Or Do I have to start from scratch?
Please see the Preferences documentation and API reference, in particular Adding preferences to an extension and Code Snippets.
Just to be clear: The nsIPreference* APIs can be used to query/modify any preference, not just add-on specific ones.
SDK users should use simple-prefs (for add-on prefs), and/or preferences/service.

Resources