Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization - fr #265

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/build/hello-world-dapp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Here we are importing the necessary functions from the Massa AssemblyScript SDK.

:::info
If you are familiar with Solidity smart contracts, you will soon notice that some object provided by Massa AssemblyScript SDK are very similar to the ones provided by the Solidity SDK. For example, the `Context` object is very similar to the `msg` object in Solidity. It exposes methods such as `Context.transferredCoins()` which would translate to `msg.value` in Solidity. `Context.caller()` would return the address of the function caller like `msg.sender` in solidity. Similarly, the `generateEvent` function is very similar to the `emit` function in Solidity, etc.
You can learn more about the Massa AssemblyScript SDK [here](docs/build/smart-contract/as-sdk.md).
You can learn more about the Massa AssemblyScript SDK [here](./smart-contract/as-sdk.md).
:::

- **The constructor function**
Expand All @@ -146,19 +146,19 @@ Storage.set("greeting", "Hello, World!");
This line sets the greeting message in the contract storage. The `Storage.set()` function takes two parameters: the key and the value. The key is a string that will be used to retrieve the value from the storage. The value can be of any type. In this example, we are using a string.

:::info
In Massa, if you want some data to be persistent on the blockchain, you need to store it in the contract storage. If you are familiar with web development, you can think of the storage as the database of your application. The contract storage is a key-value store that can be used to store simple objects such as our "Hello, World!" string, or more complex objects such as serializable object arrays. Then the data can be retrieved from the storage using methods such has `Storage.get()` or `Storage.has()` provided by the SDK. You can learn more about how to handle the storage with Massa AS-SDK [here](docs/build/smart-contract/as-sdk.md#storage).
In Massa, if you want some data to be persistent on the blockchain, you need to store it in the contract storage. If you are familiar with web development, you can think of the storage as the database of your application. The contract storage is a key-value store that can be used to store simple objects such as our "Hello, World!" string, or more complex objects such as serializable object arrays. Then the data can be retrieved from the storage using methods such has `Storage.get()` or `Storage.has()` provided by the SDK. You can learn more about how to handle the storage with Massa AS-SDK [here](/docs/build/smart-contract/as-sdk.md#storage).
:::

:::info
In Massa, when writing to the persistent storage a.k.a the ledger, you need to pay for the storage space you will be using. The more data you store, the more you will have to pay. Similarly when you free-up some space from the ledger, you recover the amount of coins you paid to allocate the space. The price of storage is a fixed amount of Massa coins for each byte of data (0.001 MAS per byte). You can learn more about storage cost in Massa smart contracts [here](docs/learn/storage-costs.mdx).
In Massa, when writing to the persistent storage a.k.a the ledger, you need to pay for the storage space you will be using. The more data you store, the more you will have to pay. Similarly when you free-up some space from the ledger, you recover the amount of coins you paid to allocate the space. The price of storage is a fixed amount of Massa coins for each byte of data (0.001 MAS per byte). You can learn more about storage cost in Massa smart contracts [here](/docs/learn/storage-costs.mdx).
:::

- **Emitting an event**

```tsx
generateEvent(`Greeting has been set`);
```
Here, we are emitting an event to notify that the greeting message has been set. Events are a great way to notify the front ends of a dApp that something has happened. They are similar to events in Solidity. You can learn more about events [here](docs/build/smart-contract/as-sdk.md#utilities).
Here, we are emitting an event to notify that the greeting message has been set. Events are a great way to notify the front ends of a dApp that something has happened. They are similar to events in Solidity. You can learn more about events [here](/docs/build/smart-contract/as-sdk.md#utilities).

Now that we have written our smart contract, let's deploy it to the blockchain.

Expand Down
9 changes: 7 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const config = {
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
locales: ["en", "fr"],
},

stylesheets: [
Expand All @@ -55,7 +55,8 @@ const config = {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/massalabs/docs/tree/main/",
editUrl: "https://github.com/massalabs/doc/tree/main/",
editLocalizedFiles: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [math, remarkGridTables],
Expand Down Expand Up @@ -111,6 +112,10 @@ const config = {
position: "left",
label: "🧩 Massa Station",
},
{
type: "localeDropdown",
position: "right",
},
{
type: "search",
position: "right",
Expand Down
Loading
Loading