transloadit / uppy

The next open source file uploader for web browsers :dog:
https://uppy.io
MIT License
29.27k stars 2.01k forks source link

i18n "Shared with me" etc #5294

Open mifi opened 5 months ago

mifi commented 5 months ago

Initial checklist

Problem

Fake folders like "Shared with me" (Google Drive / Photos) is currently hardcoded in Companion and returned to Uppy and therefore cannot be i18n in the client.

https://github.com/transloadit/uppy/blob/46e6be8f1a8f68332b8d2673683345dba9415dfb/packages/%40uppy/companion/src/server/provider/google/drive/adapter.js#L174

Solution

Not sure the best way to support i18n, but maybe leave name as undefined and have a separate field named something like specialFolderType which can then be i18n in the Uppy frontend? (maybe Uppy can set name to this i18n value when it receives a folder with specialFolderType from companion)

see also https://github.com/transloadit/uppy/pull/5275#issuecomment-2200015422

Alternatives

implement i18n in companion too and detect the client's language

lakesare commented 5 months ago

Agreed we should translate "Shared with me"/"Albums"/"Timeline". The solution you described sounds good to me, given partialTreeFolder.data.name gets filled with the i18n value as soon as the file is fetched, making item.data.name always a string.