mirror of
https://github.com/curlconverter/curlconverter.git
synced 2022-05-22 02:35:29 +03:00
support Locale-Specific Translation strings (#402)
This commit is contained in:
committed by
GitHub
parent
763645d050
commit
5f7fb52258
@@ -13,7 +13,7 @@ data = {
|
||||
response = requests.post('http://example.com', data=data)
|
||||
```
|
||||
|
||||
You can choose the output language by passing `--language <language>`. The options are `python` (the default), `javascript`/`node`/`node-request`, `php`, `go`, `java`, `r`, `rust`, `elixir`, `dart`, `matlab`, `cfml` and a few more.
|
||||
You can choose the output language by passing `--language <language>`. The options are `python` (the default), `javascript`/`node`, `node-axios`, `php`, `go`, `java`, `r`, `rust`, `elixir`, `dart`, `matlab` and a few more.
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
|
||||
|
||||
@@ -849,6 +849,9 @@ const parseDoubleQuoteString = (str: string): string => {
|
||||
const unescapeChar = (m: string) => (m.charAt(1) === "\n" ? "" : m.charAt(1));
|
||||
return str.slice(1, -1).replace(BACKSLASHES, unescapeChar);
|
||||
};
|
||||
const parseTranslatedString = (str: string): string => {
|
||||
return parseDoubleQuoteString(str.slice(1));
|
||||
};
|
||||
// ANSI-C quoted strings look $'like this'.
|
||||
// Not all shells have them but bash does
|
||||
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
||||
@@ -957,6 +960,8 @@ function toVal(node: Parser.SyntaxNode, curlCommand: string): string {
|
||||
return parseSingleQuoteString(node.text);
|
||||
case "ansii_c_string":
|
||||
return parseAnsiCString(node.text);
|
||||
case "string_expansion":
|
||||
return parseTranslatedString(node.text);
|
||||
case "concatenation":
|
||||
// item[]=1 turns into item=1 if we don't do this
|
||||
// https://github.com/tree-sitter/tree-sitter-bash/issues/104
|
||||
|
||||
Reference in New Issue
Block a user