npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@talend/scripts-locales

v1.1.2

Published

manage locales in the project

Downloads

730

Readme

@talend/scripts-locales

This package expose a command line useful to manage locales.

Commands:

  • npx @talend/scripts-locales update-code --ref ./node_modules/@talend/locales-tui-components/locales/en --comp=all ./packages/components/src/ will update default message inside source by using english translations (ref).
args[0] => reference -> locales_en.json or the folder with multiple locale json (for ex: settings.json, app.json etc.,)
args[1] => i18n component to find -> can be any of ['i18n', 'trans', 'all']
        -- usage "--comp=i18n" || "--comp=trans"  || "--comp=i18n,trans" || "--comp=all"
args[2] => target -> folder with application source (ex: ./packages)

Steps to run the script:

  1. Run "eslint --fix" and prettier on the target folder and merge the changes in master.
  2. Run npx @talend/scripts-locales update-code --ref ./locales/en -t ./src from your new branch.
  3. Use "lint-staged" pre-commit or run "eslint --fix" and "prettier --write" on the target folder.
  4. Review "Trans" components and all the translated locales in your PR.

Codeshift for t() functions

This codeshift will search all i18n call expressions and replaces the default values with the provided translation file

Finds all usage of: i18n.t(), props.t(), rest.t(), ownprops.t(), config.t(), t()

This script transform this pattern

i18n.t('TASK_HISTORY_DETAIL_STATUS_REQUEST_TO_EXECUTE', {
	defaultValue: 'Run task',
});

into

i18n.t('TASK_HISTORY_DETAIL_STATUS_REQUEST_TO_EXECUTE', {
	defaultValue: 'Request to run task',
});

Codeshift for component

The goal is to find all component in the source code. See TmcTutorial.container.js for example. And to replace the values with the content of portal-app.json

/!\ there are still some indentation issues in the result of the codemod if the content of the trans component is not surrounded with some html tags.

This script transform this pattern

<Trans i18nKey="TUTORIAL_TMC_INTRO" t="{t}">
	<p>
		Develop data integration, big data and real-time analytics Jobs, REST and SOAP Services, and
		Mediation Routes in Talend Studio, and then deploy them in the cloud. Talend Cloud helps
		increase productivity and optimize all types of integration with instant, elastic, and secure
		capacity.
	</p>
	<p>
		Talend Management Console helps govern, manage, deploy, and monitor the execution of all types
		of artifacts.
	</p>
</Trans>
<Trans i18nKey="DOWNLOAD_REMOTE_ENGINE_PIPELINES_TEXT_1" t="{t}">
	<p>Use a {{ remoteEngineName }} to execute pipeline tasks on premises.</p>
	<p>Download the archive and install the {{ remoteEngineName }} on any platform you need:</p>
</Trans>
<Trans t="{t}" i18nKey="DOWNLOAD_INTRO_NO_DOWNLOADS">
	There is nothing to download!
	<br />
	If you think there is something missing, check your subscription options or contact your
	administrator.
</Trans>

into

<Trans i18nKey="TUTORIAL_TMC_INTRO" t="{t}">
	<p>
		Develop data integration, big data and real-time analytics Jobs, REST and SOAP services, and
		Mediation Routes in Talend Studio, and then deploy them in the cloud. Talend Cloud helps
		increase productivity and optimize all types of integration with instant, elastic, and secure
		capacity.
	</p>
	<p>
		Talend Management Console helps govern, manage, deploy, and monitor the execution of all types
		of artifacts.
	</p>
</Trans>
<Trans i18nKey="DOWNLOAD_REMOTE_ENGINE_PIPELINES_TEXT_1" t="{t}">
	<p>Use a {{ remoteEngineName }} to execute pipeline tasks on premises.</p>
	<p>Download the archive and install the {{ remoteEngineName }} on any platform you need:</p>
</Trans>
<Trans t="{t}" i18nKey="DOWNLOAD_INTRO_NO_DOWNLOADS">
	There is nothing to download!
	<br />
	If you think there is something missing, check your subscription options or contact your
	administrator.
</Trans>