@atlassian/i18n-properties-loader

中文文档
2.1.0发布于 2026/07/22Apache-2.0CommonJS近 30 天下载 1870

A webpack loader for i18n *.properties files that can be used in Atlassian Server products

原始使用文档
文档目录8 节
  1. Motivation
  2. Installation
  3. Usage example
  4. Options
  5. Creating production bundle
  6. React i18n helper
  7. Additional links
  8. Minimum requirements

@atlassian/i18n-properties-loader

node version npm downloads

A loader for i18n *.properties files that can be used with webpack or rspack in Atlassian Server products and plugins.

Motivation

If your work with the modern Front-End Server code there is a good chance you are already using the Atlassian Web-Resource webpack Plugin. If you did configure your webpack to use development server you might be missing displaying translation phrases right now.

The @atlassian/i18n-properties-loader can help you with solving that problem. It's a webpack loader that allows you displaying translation phrases during your development workflow and at the same time uses the WRM.

For more information about the translations system check the Atlassian Development documentation page:

Installation

npm install @atlassian/i18n-properties-loader --save-dev

Usage example

// webpack.config.js

const myI18nFiles = [
  'foo/i18n/my-translation-file.properties',
  'foo/bar/i18n/my-other-translation-file.properties',
  'bar/i18n/some-translation-file.properties',
];

module.exports = {
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        include: ['src'],

        use: [
          {
            loader: '@atlassian/i18n-properties-loader',
            options: {
              i18nFiles: myI18nFiles,
            },
          },

          {
            loader: 'babel-loader',
          },
        ],
      },
    ],
  },
};

Options

  • i18nFiles list of paths to your *.properties files (required)
  • disabled disables the loader; can we used to disabled in production bundle (optional, default false)

Creating production bundle

The loader is required only in development mode. You should remember to disable it when you are creaing production bundle.

With webpack and its mode configuration you can intercept the currently selected mode inside your webpack configuration and disable the loader accoridngly:

// webpack.config.js

module.exports = (env, argv) => {
  const isDevelopmentMode = argv.mode === 'development'; // 1. Check if we are running webpack in "development" mode

  return {
    module: {
      rules: [
        {
          test: /\.jsx?$/,
          include: ['src'],

          use: [
            {
              loader: '@atlassian/i18n-properties-loader',
              options: {
                i18nFiles,
                disabled: !isDevelopmentMode, // 2. Skip and disable loader when webpack is running in "production" mode
              },
            },

            {
              loader: 'babel-loader',
            },
          ],
        },
      ],
    },
  };
};

React i18n helper

This package plays nice with the @atlassian/wrm-react-i18n when you want to use I18n.getText() translation helper with React components.

You can check the package description for more details and learn how to integrate it with your webpack configuration.

Minimum requirements

This plugin is compatible with:

  • webpack 5, or rspack 1 or 2
  • Node 12+

版本与发布记录

@atlassian/i18n-properties-loader 共发布 58 个版本,首次发布于 2019/04/02;过去 12 个月发布了 13 个版本。

版本发布日期距今
2.1.0latest2026/07/223 个月前
2.0.22026/05/295 个月前
2.0.1-8db0611hash-release2026/05/285 个月前
2.0.12026/05/125 个月前
2.0.02026/04/296 个月前
1.1.72026/04/096 个月前

其他发布通道:alpha → 0.10.0-alpha.0,snapshot → 0.0.0-snapshot.1,test → 0.0.0-test-release.2,hash-release → 2.0.1-8db0611。

关于 @atlassian/i18n-properties-loader 的常见问题

@atlassian/i18n-properties-loader 是什么?

A webpack loader for i18n *.properties files that can be used in Atlassian Server products

如何安装 @atlassian/i18n-properties-loader?

在项目目录运行 npm install @atlassian/i18n-properties-loader,或使用 pnpm add / yarn add / bun add。

@atlassian/i18n-properties-loader 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/atlassian__i18n-properties-loader 是否存在。

@atlassian/i18n-properties-loader 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@atlassian/i18n-properties-loader 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=12。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@atlassian/i18n-properties-loader 可以商用吗?

@atlassian/i18n-properties-loader 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@atlassian/i18n-properties-loader 的下载量有多少?

根据 npm 官方下载统计,@atlassian/i18n-properties-loader 在 2026/10/07 – 2026/11/05 这 30 天内被下载 1,870 次,日均约 62 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@atlassian/i18n-properties-loader 还在维护吗?

最新版本 2.1.0 发布于 2026/07/22(3 个月前);至今共发布 58 个版本,其中过去 12 个月发布了 13 个;首次发布于 2019/04/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。