n1crack / vuefinder

Empower your Vue.js applications with this versatile and customizable file manager component, simplifying file organization and navigation.
https://vuefinder.ozdemir.be
MIT License
259 stars 75 forks source link

Refactoring #34

Closed n1crack closed 9 months ago

n1crack commented 9 months ago
n1crack commented 9 months ago

@DreamlandOwO we should refactor uppy codes. Before it was less than 140lines, now it is almost 500 lines of code. I'm gonna leave it to you 😆 I have no idea whats going on there..

n1crack commented 9 months ago

Ok, big update related to localization part. Multi language will not be loaded automatically, you need to import the language files yourself when registering the component.

so registering the Vuefinder like this:

app.use(VueFinder)

as a result, lang dropdown will be hidden, and english will be the main language :

image

The localization files are under the "dist/locales" folder.

Normally, you would like to import the locales from the package, the only thing, just be sure the locale keys matches the filename..

app.use(VueFinder,
   {
       i18n: {   
           en: async () => await import ("vuefinder/dist/locales/en.js"),
           // add many as you like, they will be added to dropdown in the vuefinder's settings modal.
       }
   }
)

if you dont want to import async, you can import the locales like this.

//..
 import en from "vuefinder/dist/locales/en.js"
 import fr from "vuefinder/dist/locales/fr.js"
 // other langs..
//..
app.use(VueFinder, 
  {
       i18n: { en, fr }
   }
)

this should be added the documentation ofc.

n1crack commented 9 months ago

I had to put i18n insiide computed object, it wasn't updated as expected. i18n functionality should be refactored later.

https://github.com/n1crack/vuefinder/blob/970abdd73ac10b4aaa5d5ab801061d8ab5b12dee/src/ServiceContainer.js#L16

I think we are close to finishing this PR. Maybe we should make another PR for the last 2 todo items.