duration-translation

1.0.2 • Public • Published

duration-translation

npm version

The duration-translation package is a lightweight npm module that allows you to translate time durations into different languages. It provides a simple and flexible way to convert seconds, minutes, hours, days, months and years into their corresponding localized forms.

Installation

Install the package using npm:

npm install duration-translation Usage Import the package into your project:

const duration = require('duration-translation');

//Translate a duration to a specific language:
let translatedDuration = duration('1m', 'hu');
console.log(translatedDuration); // Output: '1 perc'

You can use the duration function to translate time durations into various languages. The first argument is the duration string (e.g., '1m' for 1 minute), and the second argument is the language code (e.g., 'hu' for Hungarian).

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

This package is open source and available under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i duration-translation

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

8.56 kB

Total Files

12

Last publish

Collaborators

  • itzandriss