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.

Register $t globally

See original GitHub issue

Please register $t globally per default. Now we need each time:

import Vue from 'vue'
const $t = Vue.t
// before we can use:
var title = $t("header.title")

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
exoegocommented, Sep 3, 2019

Did you try add return keyword in factory function?

default() {
  return this.$t('close');
},
1reaction
tvldcommented, Jan 22, 2019

I am not sure if this is helpful, but I use something like this successfully:

export default {
  data: function () {
    return {
      // just some example of an array with translated labels
      pricesHeader: this.$i18n.t('prices.header'),
      fields: [
        { key: 'label', label: this.$i18n.t('prices.label') },
        { key: 'service', label: this.$i18n.t('prices.info') },
        { key: 'tokens', label: this.$i18n.t('prices.tokens') }
      ]
    }
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Apply for Global Entry - Customs and Border Protection
Log in to your TTP account and complete the application. A $100 non-refundable fee is required with each completed application. Schedule an ...
Read more >
Register Trademark Worldwide: Everything You Need to Know
If you register a trademark worldwide, the word, phrase, symbol, design, or logo you register officially distinguish your goods or services from all...
Read more >
How Do I Register a Trademark or Service Mark Internationally?
If you are using a trademark or service mark internationally, protect it by registering it internationally using the Madrid Protocol.
Read more >
How to Register a Trademark Internationally - YouTube
Contrary to popular belief, there isn' t a way to register a trademark internationally within every country all at once.
Read more >
How to Register a Trademark Internationally - Gerben Law Firm
Contrary to popular belief, there isn't a single way to register your trademark in every country around the world. Each individual country is...
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