vscode-cucumber icon indicating copy to clipboard operation
vscode-cucumber copied to clipboard

Add support for i18n languages

Open lucaslizama opened this issue 8 years ago • 4 comments

I´m a Spanish speaker so it would be nice if you could add at least syntax highlight for other languages, there is an extension in ATOM that does this.

lucaslizama avatar Mar 22 '17 14:03 lucaslizama

Snippets for PT-BR:

{
  "cen": {
    "prefix": "cen",
    "body": "Cenário: ${1:titulo para o cenário}\r\n$0",
    "description": "Cenário (Apenas o inicio)",
    "scope": "text.gherkin.feature"
  },
  "cenario": {
    "prefix": "cenario",
    "body": [
      "Cenário: ${1:titulo}",
      "\tDado ${2:contexto}",
      "\tQuando ${3:evento}",
      "\tEntão ${4:resultado}\r\n$0\r\n$0"
    ],
    "description": "Cenário Completo",
    "scope": "text.gherkin.feature"
  },
  "esqc": {
    "prefix": "esqc",
    "body": [
      "Esquema do Cenário: ${1:titulo}",
      "\tDado ${2:contexto}",
      "\tQuando ${3:evento}",
      "\tEntão ${4:resultado}"
    ],
    "description": "Esquema do Cenário",
    "scope": "text.gherkin.feature"
  },
  "dado": {
    "prefix": "dado",
    "body": "Dado ${1:contexto}",
    "description": "Step Quando (Texto simples)",
    "scope": "text.gherkin.feature"
  },
  "quando": {
    "prefix": "quando",
    "body": "Quando ${1:evento}",
    "description": "Step Quando (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "entao": {
    "prefix": "entao",
    "body": "Então ${1:resultado}",
    "description": "Step Então (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "mas": {
    "prefix": "mas",
    "body": "Mas ${1:condição}",
    "description": "Step Mas (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "e": {
    "prefix": "e",
    "body": "E ${1:condição}",
    "description": "Step E (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "func": {
    "prefix": "func",
    "body": [
      "Funcionalidade: ${1:titulo}",
      "\tCom o objetivo de ${2:valor}",
      "\tComo um ${3:funcao}",
      "\tEu quero uma ${4:funcionalidade}\r\n",
      "\t$0"
    ],
    "description": "Funcionalidade",
    "scope": "text.gherkin.feature"
  },
  "exemplos": {
    "prefix": "exemplos",
    "body": [
      "Exemplos:",
      "\t|Cabeçalho 1|Cabeçalho 2|Cabeçalho 3|",
      "\t|Conteúdo 1 |Conteúdo 2 |Conteúdo 3 |"
    ],
    "description": "Exemplo de uso de tabelas",
    "scope": "text.gherkin.feature"
  },
  "funcionalidade_exemplo": {
    "prefix": "funcionalidade_exemplo",
    "body": [
      "Funcionalidade: ${1:titulo}",
      "\tCom o objetivo de ${2:valor}",
      "\tComo um ${3:funcao}",
      "\tEu quero uma ${4:funcionalidade}\r\n",
      "\tCenário: ${5:titulo}",
      "\t\tDado ${6:contexto} <Cabeçalho 1>",
      "\t\tQuando ${7:evento}",
      "\t\tEntão ${8:resultado}\r\n",
      "\tExemplos:",
      "\t\t|Cabeçalho 1|Cabeçalho 2|Cabeçalho 3|",
      "\t\t|Conteúdo 1 |Conteúdo 2 |Conteúdo 3 |"
    ],
    "description": "Funcionalidade completa",
    "scope": "text.gherkin.feature"
  }
}

dialex avatar Mar 10 '18 14:03 dialex

Snippets for PT-BR:

{
  "cen": {
    "prefix": "cen",
    "body": "Cenário: ${1:titulo para o cenário}\r\n$0",
    "description": "Cenário (Apenas o inicio)",
    "scope": "text.gherkin.feature"
  },
  "cenario": {
    "prefix": "cenario",
    "body": [
      "Cenário: ${1:titulo}",
      "\tDado ${2:contexto}",
      "\tQuando ${3:evento}",
      "\tEntão ${4:resultado}\r\n$0\r\n$0"
    ],
    "description": "Cenário Completo",
    "scope": "text.gherkin.feature"
  },
  "esqc": {
    "prefix": "esqc",
    "body": [
      "Esquema do Cenário: ${1:titulo}",
      "\tDado ${2:contexto}",
      "\tQuando ${3:evento}",
      "\tEntão ${4:resultado}"
    ],
    "description": "Esquema do Cenário",
    "scope": "text.gherkin.feature"
  },
  "dado": {
    "prefix": "dado",
    "body": "Dado ${1:contexto}",
    "description": "Step Quando (Texto simples)",
    "scope": "text.gherkin.feature"
  },
  "quando": {
    "prefix": "quando",
    "body": "Quando ${1:evento}",
    "description": "Step Quando (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "entao": {
    "prefix": "entao",
    "body": "Então ${1:resultado}",
    "description": "Step Então (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "mas": {
    "prefix": "mas",
    "body": "Mas ${1:condição}",
    "description": "Step Mas (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "e": {
    "prefix": "e",
    "body": "E ${1:condição}",
    "description": "Step E (Texto Simples)",
    "scope": "text.gherkin.feature"
  },
  "func": {
    "prefix": "func",
    "body": [
      "Funcionalidade: ${1:titulo}",
      "\tCom o objetivo de ${2:valor}",
      "\tComo um ${3:funcao}",
      "\tEu quero uma ${4:funcionalidade}\r\n",
      "\t$0"
    ],
    "description": "Funcionalidade",
    "scope": "text.gherkin.feature"
  },
  "exemplos": {
    "prefix": "exemplos",
    "body": [
      "Exemplos:",
      "\t|Cabeçalho 1|Cabeçalho 2|Cabeçalho 3|",
      "\t|Conteúdo 1 |Conteúdo 2 |Conteúdo 3 |"
    ],
    "description": "Exemplo de uso de tabelas",
    "scope": "text.gherkin.feature"
  },
  "funcionalidade_exemplo": {
    "prefix": "funcionalidade_exemplo",
    "body": [
      "Funcionalidade: ${1:titulo}",
      "\tCom o objetivo de ${2:valor}",
      "\tComo um ${3:funcao}",
      "\tEu quero uma ${4:funcionalidade}\r\n",
      "\tCenário: ${5:titulo}",
      "\t\tDado ${6:contexto} <Cabeçalho 1>",
      "\t\tQuando ${7:evento}",
      "\t\tEntão ${8:resultado}\r\n",
      "\tExemplos:",
      "\t\t|Cabeçalho 1|Cabeçalho 2|Cabeçalho 3|",
      "\t\t|Conteúdo 1 |Conteúdo 2 |Conteúdo 3 |"
    ],
    "description": "Funcionalidade completa",
    "scope": "text.gherkin.feature"
  }
}

I would like to know where I can put this snippet. Thank you in advance.

lflucasferreira avatar Jan 10 '20 00:01 lflucasferreira

TBH I don't know how to achieve i18n support on a VS Code extension. Desculpa 😞

dialex avatar Jan 10 '20 11:01 dialex

Hello. language-gherkin-i18n plugin uses firstLineMatch tmLanguage-feature to select correct scopeName.

nixel2007 avatar Jan 10 '20 11:01 nixel2007