Skip to content
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
67 changes: 41 additions & 26 deletions inert.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ const {

const fs = require("fs");

const itConfig = require("./it.lang.js");
const arConfig = require("./ar.lang.js");
const enConfig = require("./en.lang.js");
const deConfig = require("./de.lang.js");
const zhConfig = require("./zh.lang.js");
const ukConfig = require("./uk.lang.js");
const ptBRConfig = require("./ptBR.lang.js");
const kuConfig = require("./ku.lang.js");
const esConfig = require('./es.lang.js');
const esConfig = require("./es.lang.js");
const frConfig = require("./fr.lang.js");
const trConfig = require("./tr.lang.js");
const krConfig = require("./kr.lang.js");
Expand All @@ -33,9 +34,11 @@ const ruConfig = require("./ru.lang.js");
const jaConfig = require("./ja.lang.js");
const zhTWConfig = require("./zhTW.lang.js");

const data = fs.existsSync('./temp/data.json') ? require('./temp/data.json') : {
sponsors: []
};
const data = fs.existsSync("./temp/data.json")
? require("./temp/data.json")
: {
sponsors: [],
};

// List of languages
const langs = [
Expand Down Expand Up @@ -116,8 +119,9 @@ const langs = [
dir: "ltr",
name: "Русский",
prefix: "/ru/",
config: ruConfig
},{
config: ruConfig,
},
{
dir: "rtl",
name: "Arabic",
prefix: "/ar/",
Expand All @@ -128,14 +132,21 @@ const langs = [
dir: "ltr",
name: "日本語",
prefix: "/ja/",
config: jaConfig
config: jaConfig,
},
{
dir: "ltr",
name: "繁體中文",
prefix: "/zhTW/",
config: zhTWConfig
}
config: zhTWConfig,
},
{
dir: "ltr",
name: "Italiano",
prefix: "/",
postsDir: "/it/",
config: itConfig,
},
];

/**
Expand All @@ -153,7 +164,7 @@ module.exports = {
title: "Axios Docs",
// List of languages
langs: langs,
...data
...data,
},
build: {
/**
Expand Down Expand Up @@ -257,9 +268,10 @@ module.exports = {
...langs
.map((lang) => [
singleHTMLBuild(lang.config),
writeFile(lang.prefix === '/'
? ':output:/index.html'
: `:${lang.prefix.slice(1, -1)}Output:/index.html`
writeFile(
lang.prefix === "/"
? ":output:/index.html"
: `:${lang.prefix.slice(1, -1)}Output:/index.html`
),
])
.flat(),
Expand Down Expand Up @@ -333,19 +345,22 @@ module.exports = {
],
},
},
...langs.map(
(lang) => ({
folder: `posts/${lang.postsDir || lang.prefix.slice(1, -1)}`,
build: {
traverseLevel: "recursive",
filePipeline: [
markdown(),
htmlBuild("post", lang.config),
write(lang.prefix === '/' ? 'postOutput' : `${lang.prefix.slice(1, -1)}Posts`, ".html"),
],
},
})
),
...langs.map((lang) => ({
folder: `posts/${lang.postsDir || lang.prefix.slice(1, -1)}`,
build: {
traverseLevel: "recursive",
filePipeline: [
markdown(),
htmlBuild("post", lang.config),
write(
lang.prefix === "/"
? "postOutput"
: `${lang.prefix.slice(1, -1)}Posts`,
".html"
),
],
},
})),
],
},
};
158 changes: 158 additions & 0 deletions it.lang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/**
* Configuration for the english (original) translation
*/

module.exports = {
// Language display name. MUST BE THE SAME AS IN [inert.config.js].custom.langs
display: "Italiano",
prefix: "/",
dir: "ltr",
lang: "it",
// `p` stands for `paragraph`. This will contain translations of full text blocks
p: {
headline: "Client HTTP per node e browser, basato sulle Promise.",
subhead: `Axios è un Client HTTP per node.js e browser, basato sulle Promise.
Axios fornisce una libreria di semplice utilizzo contenuta in un pacchetto molto piccolo e un'interfaccia estendibile.`,
sponsors: `<p>Grazie per aver deciso di supportare il progetto.</p>
<p>Verrai automaticamente aggiunto a questa lista entro 24 ore se il tier che hai scelto lo comprende.</p>
<div class="social"><a class="link" href="/docs/sponsor">Scopri di più...</a></div>
`,
},
// `t` stands fot `translation`. This will contain translations of single words or phrases
t: {
"Come Iniziare": undefined,
"Vai al GitHub": undefined,
Lingue: undefined,
"Open Source": undefined,
Contribuisci: undefined,
"Sorgente su GitHub": undefined,
Problemi: undefined,
"Pull Requests": undefined,
"Codice di Condotta": undefined,
"Fai un Fork su GitHub": undefined,
"Fai un Fork del Sito Web": undefined,
"Segnala un problema": undefined,
Successivo: undefined,
Precedente: undefined,
"Website Copy Right Footer": undefined,
"Vai al Github": undefined,
"Axios Project Copy Right Footer": undefined,
"License Label Footer": undefined,
Sponsors: undefined,
"Diventa uno Sponsor": undefined,
"Sponsor Oro": undefined,
},
sidebar: [
{
type: "heading",
text: "Come Iniziare",
},
{
type: "link",
href: "/docs/intro",
text: "Introduzione",
},
{
type: "link",
href: "/docs/example",
text: "Esempio di Utilizzo",
},
{
type: "link",
href: "/docs/post_example",
text: "Richieste POST",
},
{
type: "heading",
text: "Axios API",
},
{
type: "link",
href: "/docs/api_intro",
text: "Axios API",
},
{
type: "link",
href: "/docs/instance",
text: "L'Istanza Axios",
},
{
type: "link",
href: "/docs/req_config",
text: "Configurazione della Richiesta",
},
{
type: "link",
href: "/docs/res_schema",
text: "Schema della Risposta",
},
{
type: "link",
href: "/docs/config_defaults",
text: "Valori Predefiniti",
},
{
type: "link",
href: "/docs/interceptors",
text: "Interceptors",
},
{
type: "link",
href: "/docs/handling_errors",
text: "Gestione degli Errori",
},
{
type: "link",
href: "/docs/cancellation",
text: "Annullamento delle Richieste",
},
{
type: "link",
href: "/docs/urlencoded",
text: "🆕 Corpo con URL-Encoding",
},
{
type: "link",
href: "/docs/multipart",
text: "🆕 Corpo Multipart",
},
{
type: "heading",
text: "Altro",
},
{
type: "link",
href: "/docs/notes",
text: "Note",
},
{
type: "heading",
text: "Collaboratori",
},
{
type: "link",
href: "/docs/sponsor",
text: "Sponsorizzare Axios",
},
{
type: "link",
href: "https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md",
text: "Codice di Condotta",
},
{
type: "link",
href: "https://github.com/axios/axios/blob/v1.x/COLLABORATOR_GUIDE.md",
text: "Guida per la Collaborazione",
},
{
type: "link",
href: "https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md",
text: "Contribuire ad Axios",
},
{
type: "link",
href: "/docs/translating",
text: "Tradurre la documentazione",
},
],
};
70 changes: 70 additions & 0 deletions posts/it/api_intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "Axios API"
description: "Documentazione API di Axios"
prev_title: "Richieste POST"
prev_link: "/docs/post_example"
next_title: "L'istanza Axios"
next_link: "/docs/instance"
---

Le richieste possono essere effettuate passando un oggetto di configurazione come parametro di `axios`.

##### axios(config)

```js
// Richiesta POST
axios({
method: "post",
url: "/user/12345",
data: {
firstName: "Fred",
lastName: "Flintstone",
},
});
```

```js
// Richiesta GET per un'immagine remota con node.js
axios({
method: "get",
url: "http://bit.ly/2mTM3nY",
responseType: "stream",
}).then(function (response) {
response.data.pipe(fs.createWriteStream("ada_lovelace.jpg"));
});
```

##### axios(url[, config])

```js
// Inviare una richiesta GET (metodo predefinito)
axios("/user/12345");
```

### Alias dei metodi di richiesta

Per comodità, vengono utilizzati degli alias per tutti i metodi di richiesta supportati.

##### axios.request(config)

##### axios.get(url[, config])

##### axios.delete(url[, config])

##### axios.head(url[, config])

##### axios.options(url[, config])

##### axios.post(url[, data[, config]])

##### axios.put(url[, data[, config]])

##### axios.patch(url[, data[, config]])

##### axios.postForm(url[, data[, config]])

##### axios.putForm(url[, data[, config]])

##### axios.patchForm(url[, data[, config]])

> NOTA: Quando si usano gli alias, non serve specificare le proprietà `url`, `method`, e `data` all'interno di config.
Loading