Skip to content

Commit

Permalink
Sync with Kendo UI Professional
Browse files Browse the repository at this point in the history
  • Loading branch information
Kendo Bot committed Nov 8, 2022
1 parent 28dc39b commit c777ce4
Show file tree
Hide file tree
Showing 108 changed files with 319 additions and 78 deletions.
4 changes: 2 additions & 2 deletions docs-aspnet/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,10 @@ navigation:
baseurl: /aspnet-core

## The Kendo UI version used
cdnVersion: "2022.3.913"
cdnVersion: "2022.3.1108"

## The MVC Core version used
mvcCoreVersion: "2022.3.913"
mvcCoreVersion: "2022.3.1108"

ff-sheet-id: 1mottKpkbJFxkUq6rS3CsPrT8JQOE2JlUtsJBR622cxs

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 24 additions & 28 deletions docs-aspnet/globalization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ position: 3

You can change the messages that are displayed in the {{ site.product }} helpers by including an additional script file in the document.

## Localization Files

Officially, the {{ site.product }} components support only the English language. The community contributes to translating the messages to other languages by adding new `messages` JavaScript files and updating the existing ones in the [Kendo UI Core repository](https://github.com/telerik/kendo-ui-core/tree/master/src/messages).

To display messages in different languages, {{ site.product }} uses localization (resource) files, for example, `Messages.es-ES.resx`. The localization files are generated from the `messages` JavaScript files.

You can find the resource files in the Telerik UI source zip bundle:

{% if site.core %}
1. Log in to your [Telerik account](https://www.telerik.com/login/v2/telerik).

1. Go to the [Telerik UI for ASP.NET Core download page](https://www.telerik.com/account/downloads/product-download?product=UIASPCORE) and download the `telerik.ui.for.aspnet.core.{{ site.mvcCoreVersion }}.commercial-source.zip` file.

1. Extract the archive and navigate to the `\src\AspNet.Core\Kendo.Mvc\Resources\` folder that contains the resource files.
{% else %}
1. Log in to your [Telerik account](https://www.telerik.com/login/v2/telerik).

1. Go to the [Telerik UI for ASP.NET MVC download page](https://www.telerik.com/account/downloads/product-download?product=KENDOUIMVC) and download the `telerik.ui.for.aspnetmvc.{{ site.mvcCoreVersion }}.commercial-source.zip` file.

1. Extract the archive and navigate to the `\src\Kendo.Mvc\Kendo.Mvc\Resources\` folder that contains the resource files.
{% endif %}

> Changes made to the `messages` files through community contribution will be reflected in the {{ site.product }} release that follows that contribution. Refer to the [section on contributing](#contribution).
## Setting the Current Language

{% if site.core %}
Expand Down Expand Up @@ -59,34 +83,6 @@ The following example demonstrates how to create a new localization file. The `k
{% else %}
The culture that is used for the localization messages in Telerik UI for ASP.NET MVC is determined by the `CurrentUICulture`, not by the `CurrentCulture` property. By default, if `CurrentUICulture` is not supported, the Telerik UI for ASP.NET MVC helpers will display their messages in American English (en-US). If `CurrentUICulture` is set from code or from the `web.config` file, Telerik UI for ASP.NET MVC will use localized user interface messages.

The following table lists the localized messages for the cultures which are supported by Telerik UI for ASP.NET MVC.

| Culture | Language | Country
|:--- |:--- |:---
|`ar-AE` |Arabic |U.A.E.
|`bg-BG` |Bulgarian |Bulgaria
|`cs-CZ` |Czech |Czech Republic
|`da-DK` |Danish |Denmark
|`de-DE` |German |Germany
|`el-GR` |Greek |Greece
|`en-US` |English |United States of America
|`es-ES` |Spanish |Spain
|`fr-CA` |French |Canada
|`fr-FR` |French |France
|`he-IL` |Hebrew |Israel
|`it-IT` |Italian |Italy
|`nl-NL` |Dutch |The Netherlands
|`pl-PL` |Polish |Poland
|`pt-BR` |Portuguese |Brazil
|`pt-PT` |Portuguese |Portugal
|`ro-RO` |Romanian |Romania
|`ru-RU` |Russian |Russia
|`sk-SK` |Slovak |Slovakia
|`sv-SE` |Swedish |Sweden
|`tr-TR` |Turkish |Turkish
|`uk-UA` |Ukrainian |Ukraine
|`zh-CN` |Chinese |People's Republic of China

## Customizing the Localized Messages

Telerik UI for ASP.NET MVC uses [satellite assemblies](https://docs.microsoft.com/en-us/dotnet/framework/resources/creating-satellite-assemblies-for-desktop-apps) to support localization (user interface messages localized for a set of cultures). To change the provided localization messages, you have to build a custom `Kendo.Mvc.dll` version because `Kendo.Mvc.dll` is a strongly named assembly and its private key is not shipped as part of the distribution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,64 @@ To access the Kendo UI CDN services, you can use either the HTTP or the HTTPS pr

The URLs of the Telerik CDN have the following structure:

* `https://kendo.cdn.telerik.com/VERSION/js/FILENAME.min.js`
* `https://kendo.cdn.telerik.com/VERSION/styles/FILENAME.min.css`
* `https://kendo.cdn.telerik.com/[VERSION]/styles/[FILENAME]`—The `styles` folder contains the [minified `.css` files](#adding-the-required-css-files).
* `https://kendo.cdn.telerik.com/[VERSION]/mjs/[FILENAME]`—The `mjs` folder contains the [JavaScript modules](#using-javascript-modules).
* `https://kendo.cdn.telerik.com/[VERSION]/js/[FILENAME]`—The `js` folder contains the [bundled Kendo UI JavaScript files](#using-bundled-javascript).

In the URL above, you must replace `VERSION` and `FILENAME` with the client-side resource that you need and its version. For example, to load version `{{ site.mvcCoreVersion }}` of the minified Kendo UI scripts and the related CSS files, use these URLs:
In the sample URLs above, you must replace `[VERSION]` and `[FILENAME]` with the client-side resource that you need and its version. For example, to load version `{{ site.mvcCoreVersion }}` of the Kendo JavaScript modules and the CSS files for the Kendo Default visual theme, use these URLs:

* `https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/js/kendo.all.min.js`
* `https://kendo.cdn.telerik.com/{{ site.cdnVersion }}/mjs/kendo.all.js`
* `https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/styles/kendo.default-main.min.css`

If you prefer the HTTP protocol, replace `https` with `http` in the URLs above.
## Adding the Required CSS Files

Adding the Kendo CSS files allows you to use the [Kendo UI visual themes]({% slug sassbasedthemes_overview %}). The minified versions of the `.css` files are available in the `styles` folder of the Kendo CDN URL—`https://kendo.cdn.telerik.com/[VERSION]/styles/[FILENAME]`.

To load version `{{site.cdnVersion}}` of the desired visual theme, replace `[VERSION]` and `[FILENAME]` with their actual values, for example, `https://kendo.cdn.telerik.com/{{ site.cdnVersion }}/styles/kendo.default-main.min.css`.

## Adding the Required JavaScript Files

To import the JavaScript files required for the Telerik UI components, apply either of the following approaches:

* [Using the JavaScript modules](#javascript-modules)[A new approach introduced with version `2022.3.1109`]({% slug core_ecmascript_overview %}).
* [Using the bundled JavaScript](#bundled-javascript)—The traditional way of including the Kendo UI scripts.

### Using JavaScript Modules

The [JavaScript modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) are located in the `mjs` folder of the Kendo CDN URL—`https://kendo.cdn.telerik.com/[VERSION]/mjs/[FILENAME]`.

To include a Kendo JavaScript module in your project:

1. Use the `script` tag with the `type=module` attribute.
1. Add a reference to the global `aspnetmvc.min.js` file.

The two examples below demonstrate how to include individual component modules and all available component modules:

* Including individual component modules.

```html
<script src="https://kendo.cdn.telerik.com/{{ site.cdnVersion }}/mjs/kendo.grid.js" type="module"></script> <!-- Include the Grid module. The rest of the dependencies required by the Grid will be loaded automatically. -->
<script src="https://kendo.cdn.telerik.com/{{ site.cdnVersion }}/mjs/aspnetmvc.min.js" type="module"></script> <!-- Include the global `aspnetmvc.min.js` file. -->
```

* Including all available modules.

```html
<script src="https://kendo.cdn.telerik.com/{{ site.cdnVersion }}/mjs/kendo.all.js" type="module"></script> <!-- Include all Kendo UI modules. -->
<script src="https://kendo.cdn.telerik.com/{{ site.cdnVersion }}/mjs/aspnetmvc.min.js" type="module"></script> <!-- Include the global `aspnetmvc.min.js` file. -->
```

### Using Bundled JavaScript

The Kendo UI JavaScript files for the traditional format are located in the `js` folder of the Kendo CDN URL&mdash;`https://kendo.cdn.telerik.com/[VERSION]/js/[FILENAME]`.

To load version `{{site.cdnVersion}}` of the bundled Kendo JavaScript files, replace `[VERSION]` and `[FILENAME]` with their actual values, for example, `https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/js/kendo.all.min.js`.

## Using the CDN in Your Project

> Replace the Kendo UI version from the following code snippets with the version of the product you are using&mdash;for example, `{{ site.mvcCoreVersion }}`.
The following complete example demonstrates how to add the [CSS files](#adding-the-required-css-files) and the [bundled JavaScript](#using-bundled-javascript).

>Replace the Kendo UI version from the following code snippets with the version of the product you are using&mdash;for example, `{{ site.mvcCoreVersion }}`.

{% if site.core %}
1. Open the layout of the application. By default, it is `~\Views\Shared\_Layout.cshtml`.
Expand Down Expand Up @@ -88,8 +133,7 @@ The following articles provide solutions to common issues related to the Telerik
## Next Steps

* [Explore the helper script dependencies]({% slug script_filesfor_barcodes_widgets %})
* [Check out the PDF and Excel export support]({% slug exportsupport_core %})

* [Using ECMAScript Modules]({% slug core_ecmascript_overview %})
## See Also

* [Including Client-Side Resources]({% slug copyclientresources_aspnetmvc6_aspnetmvc %})
Expand All @@ -100,4 +144,4 @@ The following articles provide solutions to common issues related to the Telerik
* [First Steps with CLI (Online Guide)]({% slug gettingstartedcli_aspnetmvc6_aspnetmvc %})
{% else %}
* [First Steps on Visual Studio for Windows (Online Guide)]({% slug gettingstarted_aspnetmvc %})
{% endif %}
{% endif %}
103 changes: 103 additions & 0 deletions docs-aspnet/installation/adding-client-side-resources/ecmascript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: ECMAScript Modules
page_title: ECMAScript Modules
description: "Get started with {{ site.product }} and learn about the ECMAScript modules provided in the library."
slug: core_ecmascript_overview
position: 6
---

# ECMAScript Modules

As of the 2022.3.1109 version, the Kendo UI code-base is available in the form of ECMAScript modules. As the Telerik UI helpers are wrappers over the [Kendo UI widgets](https://docs.telerik.com/kendo-ui/intro/first-steps), this allows you to use another method to add the client-side resources to your application.

## ECMAScript Modules vs. Bundled Scripts

The new ECMAScript modules provide the following benefits as compared to the bundled scripts which have been used up to this point:

* [Loading single instead of multiple script files](#loading-single-script-files)
* [Dynamic script loading](#dynamic-script-loading)
* [Optimized debugging](#optimized-debugging)
* [Browser compatibility](#browser-compatibility)

### Loading Single Script Files

ECMAScript enables you to include a single script file to load a particular component. Taking the scripts for the Grid component as an example, previously, if you wanted to include just the Grid on the page instead of all available components, you had to also include every single script dependency related to it and in a specific order.

The `<head>` element of your page would've looked similar to the following code snippet:

```html
<script src="dist/js/kendo.core.js"></script>
<script src="dist/js/kendo.data.js"></script>
<script src="dist/js/kendo.columnsorter.js"></script>
<script src="dist/js/kendo.userevents.js"></script>
<script src="dist/js/kendo.draganddrop.js"></script>
<!-- And about 80 more individual scripts for every single functionality of the Grid to work properly. -->
```

With the introduction of the ECMAScript modules, you can include just a single script file, as shown in the following example. As a result, ECMAScript will automatically load all of the required dependencies without needing any additional actions on your side, which will greatly increase productivity and decrease the chances of missing any of the script files.

```html
<script src="dist/mjs/kendo.grid.js" type="module"></script>
```


### Dynamic Script Loading

Aside from using the `script` tag, you can also use the [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) call to load a module asynchronously into a potentially non-module environment.

The suggested approach is useful when, for example, you have a Grid inside a Window. The Grid component is not initialized nor needed before the Window is opened. Therefore, you don't need to import the module when the page first loads. Instead, you can load the module when the Window is opened and only then initialize the Grid component.

```javascript
(async () => {
let shouldGridModuleBeLoaded = true;

// Load the Grid module only if a condition is met.
if (shouldGridModuleBeLoaded) {
await import("/dist/mjs/kendo.grid.js");
}
})();
```

### Optimized Debugging

Another benefit of using ECMAScript is that it enables you to debug the Kendo UI for jQuery source code much easier. When you navigate to the **Devtools** > **Sources** browser tab, you will be able to see the non-minified version of the source code exactly like it is in the development environment of the product.

Additionally, the [sourcemap](https://firefox-source-docs.mozilla.org/devtools-user/debugger/how_to/use_a_source_map/index.html) files are now downloaded only when the **Devtools** is opened.

The following image showcases the directory structure of the loaded scripts in the **Devtools** browser:

![Devtools Sources Tab](/getting-started-core/images/devtools.png)

### Browser Compatibility

[ECMAScript is supported by the majority of modern browsers](https://caniuse.com/?search=es6%20modules). If a project requires older browser support, you can choose to use either of the other two available module systems&mdash;CommonJS or UMD.

## Getting the ECMAScript Files

You can obtain the ECMAScript modules in any of the following ways:

* [Install {{ site.product }}](https://docs.telerik.com/{{ site.platform }}/installation/adding-client-side-resources/using-local-files)
* [Download the Kendo UI bundle](https://docs.telerik.com/kendo-ui/intro/installation/hosting-kendoui)
* [Use the CDN](https://docs.telerik.com/{{ site.platform }}/installation/adding-client-side-resources/cdn-service)

## Manually Building the Source Code

You can manually build the source code of the components by following these steps:

1. Navigate to your [downloads](https://www.telerik.com/account/my-downloads) page.
1. Open the Kendo UI for jQuery page and scroll down to the **Source Code** section.
1. Once you have downloaded and extracted the source code, navigate to the `src` folder and open a terminal.
1. Run any of the following commands to build the source code:

```javascript
npx run scripts // Builds the bundled(traditional) version of the scripts.
npx run scripts:mjs // Builds the mjs version of the scripts.
npx run scripts:modules // Builds the esm and cjs versions of the scripts.
npx run scripts:all // Runs all of the above commands
```


## See Also

* [Using CDN]({% slug cdnservices_core %})
* [Using Local Files]({% slug using_local_client_side_resources %})
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ position: 1

# Creating Your Own Custom Bundles

Depending on your project, you may need to skip some of the Kendo UI utilities and install only what your application requires.
Depending on your project, you may need to skip some of the Kendo UI utilities and install only what your application requires.

To facilitate the customization of your project, Kendo UI for jQuery delivers a set of combined and individual scripts, and also provides further options for scripts customization.

* The [combined scripts bundles](#combined-scripts) contain the scripts of specific types of widgets (for example, desktop, hybrid) available for the different Kendo UI distributions.

* The [individual scripts bundles](#individual-scripts) contain the scripts of widgets grouped by their common functionality (for example, Charts, Editors) so that you can select which individual control to add to your project.

* Customizing your project by [creating your custom scripts](#custom-scripts) allows you to add the specific widgets and features required by your project.

* [Using ECMAScript]({% slug core_ecmascript_overview %}) allows you to import individual modules in your application. The related dependencies will be automatically bundled alongside their respective modules. This will save you the trouble of having to manually select which scripts to include in your project.

## Combined Scripts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ To provide the client-side web assets by using LibMan:
"libraries": [
{
"provider": "unpkg",
"library": "@progress/kendo-ui@2021.3.914",
"destination": "wwwroot/lib/kendo-ui/2021.3.914"
"library": "@progress/kendo-ui@{{ site.cdnVersion }}",
"destination": "wwwroot/lib/kendo-ui/{{ site.cdnVersion }}"
}
]
}
Expand Down Expand Up @@ -99,10 +99,18 @@ To provide the client-side web assets by using LibMan:
require("jquery")
window.$ = window.jQuery = $

require("../lib/kendo-ui/2021.3.914/js/kendo.all")
require("../lib/kendo-ui/2021.3.914/js/kendo.aspnetmvc")
require("../lib/kendo-ui/{{ site.cdnVersion }}/js/kendo.all")
require("../lib/kendo-ui/{{ site.cdnVersion }}/js/kendo.aspnetmvc")
```

Since version 2022.3.1109 the Kendo UI scripts can be acquired as ECMAScript. In this case, you will replace the `js/kendo.all` part with:
```javascript
require("../lib/kendo-ui/{{ site.cdnVersion }}/mjs/kendo.-componentName-")
```

Additional information you can find in the dedicated [ECMAScript Modules article]({% slug core_ecmascript_overview %})


1. Once LibMan has fetched the Kendo UI client-side files, navigate to the **wwwroot** folder and execute the following commands:
* `npm install` to install the dependencies in the local **node_modules** folder.
* `npm run build` to bundle the scripts specified in the `entry.js` file.
Expand All @@ -112,7 +120,7 @@ To provide the client-side web assets by using LibMan:
1. In the `_Layout.cshtml`, file add a reference to the desired theme, the bundled scripts, and the license file `kendo-ui-license.js`:

```_Layout.cshtml
<link rel="stylesheet" href="~/lib/kendo-ui/2021.3.914/css/web/kendo.default-v2.css" />
<link rel="stylesheet" href="~/lib/kendo-ui/{{ site.cdnVersion }}/css/web/kendo.default-v2.css" />
<script src="~/dist/bundle.js"></script>
<script src="./kendo-ui-license.js"></script>
```
Expand Down
Loading

0 comments on commit c777ce4

Please sign in to comment.