New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@laserfiche/lf-resource-library

Package Overview
Dependencies
Maintainers
5
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@laserfiche/lf-resource-library - npm Package Compare versions

Comparing version

to
1.0.0--preview-2061241180

2

package.json
{
"name": "@laserfiche/lf-resource-library",
"version": "1.0.0--preview-2042216176",
"version": "1.0.0--preview-2061241180",
"description": "a library containing resource files that can be used in conjunction with LfLocalizationService from `@laserfiche/lf-js-utils`",

@@ -5,0 +5,0 @@ "repository": {

@@ -15,3 +15,40 @@ # Introduction

# Documentation
## With LfLocalizationService from [`@laserfiche/lf-js-utils`](https://github.com/Laserfiche/lf-js-utils)
`LfLocalizationService` is a service that handles internationalization and localization, mapping text to its corresponding translated texts in the selected language. `@laserfiche/resource-manager` provides language resources files in JSON that can be utlized by LfLocalizationService.
**Install @laserfiche/lf-js-utils:**
```
npm install @laserfiche/lf-js-utils
```
**Import LfLocalizationService:**
```
import { LfLocalizationService } from "@laserfiche/lf-js-utils";
```
**In node, import any fetch polyfill which suits your requirements:**
examples:
- [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch)
- [cross-fetch](https://www.npmjs.com/package/cross-fetch)
- [whatwg-fetch](https://www.npmjs.com/package/whatwg-fetch)
**Example Usages**:
```ts
let localizationService = new LfLocalizationService();
localizationService.setLanguage('es');
await localizationService.initResourcesFromUrlAsync('https://cdn.jsdelivr.net/npm/@laserfiche/lf-resource-library@1.0.0/resources/laserfiche-base');
let loading = localizationService.getString('LOADING'); // loading -> 'Cargando...'
```
# [Icons](https://github.com/Laserfiche/lf-resource-library/blob/main/resources/icons/document-icons-documentation.md)
[**Example Usages**]
```ts
export function getDocumentIconUrlFromIconId(iconId: string): string {
return `https://cdn.jsdelivr.net/npm/@laserfiche/lf-resource-library@1.0.0/resources/icons/document-icons.svg#${iconId}`;
}
```
# Contribution
We welcome contributions and feedback. Please follow our [contributing guidelines](https://github.com/Laserfiche/lf-resource-library/blob/main/CONTRIBUTING.md).

@@ -12,3 +12,2 @@ {

"CLOSE": "Close",
"DEFAULT" : "Default",
"EMPTY_FILE_EXPLORER": "This folder is empty.",

@@ -65,2 +64,2 @@ "FIELD_NOT_DATE": "Date fields must be in the format ${0}.",

"YES": "Yes"
}
}