Chatter-Laravel / core

The Laravel single page forum package (Vue + Tailwind CSS + Laravel)
MIT License
159 stars 39 forks source link

Translations as it had the original would be great #14

Closed galdazbiz closed 3 years ago

galdazbiz commented 4 years ago

We are using the "old" forum for some time, implementing new things etc and now we've found this one. In the old one there was translations already (I pull requested it) I'm not a coder but somehow I managed to do it. Not sure if you could use that part of the code to replicate it here and I offer to maintain it from time to time as I did with the other.

sbarbat commented 4 years ago

Yeap it would be nice, but the forum works on a different way now. It is an REST API + Vuejs on the frontend. So we will need to find a way of loading all the translations when the app loads at first and then use them on the Vuejs templates. How does that sound?

gaetandezeiraud commented 4 years ago

Why not using https://kazupon.github.io/vue-i18n/ for the frontend? Or similar implementation.

gaetandezeiraud commented 4 years ago

I can make the integration if it's good for you! Vue-i18n or custom integration.

sbarbat commented 4 years ago

I think is a great idea! πŸŽ‰

Lukasz93P commented 3 years ago

@Brouilles Hi, translations sounds great, but are you working/will be working on that or you have abandoned this idea?

gaetandezeiraud commented 3 years ago

Hi. Sorry but I not working anymore on this. I have developping m'y own forums system with Livewire.

Lukasz93P commented 3 years ago

@Brouilles ok, thanks for answer ;)

Lukasz93P commented 3 years ago

@Brouilles can you help me a little bit? I'm a pure backend developer and I found adding i18n for vue a little bit difficult for me. In examples I see code like that:

const messages = {
  en: {
    message: {
      hello: 'hello world'
    }
  },
  ja: {
    message: {
      hello: 'γ“γ‚“γ«γ‘γ―γ€δΈ–η•Œ'
    }
  }
}

// Create VueI18n instance with options
const i18n = new VueI18n({
  locale: 'ja', // set locale
  messages, // set locale messages
})

// Create a Vue instance with `i18n` option
new Vue({ i18n }).$mount('#app')

I understand that locale and message will be passed to the Vue from the php backend but I dont know where they should be passed, into which file, I don't know where vue is instantiated and don't know how to pass those variables to make them work both in my own components and also for this package (after replacing hardcoded values inside this package).

Can you explain it to me?

Lukasz93P commented 3 years ago

@Brouilles @galdazbiz if you are still interested then you can look at this https://github.com/Chatter-Laravel/core/pull/39

sbarbat commented 3 years ago

Fixed in #39, thanks to @Lukasz93P