question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Framework regular expression

See original GitHub issue

Hello I’m trying to make the extention work with sails.js Using i18n with sails. js is done like this <%= __("key") %> or <%= i18n("key") %>

I’ve created the yml file as stated here https://github.com/antfu/i18n-ally/blob/master/docs/custom_framework.md

The content of the file is

languageIds:
  - javascript
  - typescript
  - javascriptreact
  - typescriptreact

keyMatchReg:
  - "(?:i18n)[\\(]['\"`]([\\w\\d\\. \\-\\[\\]]*?)['\"`]"

monopoly: false

The Key exp seems ok https://regexper.com/#(%3F%3Ai18n)[\(][‘"`]([\w\d\. \-\[\]]*%3F)[’"`]

The extension icon is visible on the left but nothing appears on it The settings file contains this code

{
    "i18n-ally.localesPaths": "config/locales",
    "i18n-ally.sortedKeys": true,
    "i18n-ally.keepFulfilled": false,
    "i18n-ally.sourceLanguage":"fr",
    "i18n-ally.displayLanguage":"fr"
}

And my sails config/I18n.js file contains

/**
 * https://sailsjs.com/docs/concepts/internationalization
 */

module.exports.i18n = {
  locales: ['fr', 'en'],
   defaultLocale: 'fr',
  localesDirectory: 'config/locales'

};

Do you have any thoughts? Thanks

EDIT(anfu): format

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hyperobjectsfrancecommented, Jan 11, 2020

I feel dumb now 😉 Thanks 😃

0reactions
antfucommented, Jan 11, 2020

@hyperobjectsfrance Looks like you are using ejs. You should also add it to the languageIds

languageIds:
  - javascript
  - typescript
  - javascriptreact
  - typescriptreact
+  - ejs
Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Framework regular expression · Issue #168 - GitHub
Hello I'm trying to make the extention work with sails.js Using i18n with sails. js is done like this <%= __("key") %> or...
Read more >
Creating a custom regex detector | Data Loss Prevention ...
A regular expression (regex) custom infoType detector allows you to create your own detectors that enable Cloud DLP to detect matches based on...
Read more >
RegExr: Learn, Build, & Test RegEx
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
Read more >
Adding custom validation with a Regular Expression
Regular Expressions  are a powerful method for matching the pattern of strings of text. This has particular relevance to text validation.
Read more >
Regular Expression Language - Quick Reference
In this quick reference, learn to use regular expression patterns to match input text. A pattern has one or more character literals, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found