Search Unity

Feedback Add a function to move strings between tables

Discussion in 'Localization Tools' started by kork, May 28, 2020.

  1. kork

    kork

    Joined:
    Jul 14, 2009
    Posts:
    280
    Sometimes you need to reorganize your strings when a table becomes too big, or you want to move some strings out into some DLC bundle. Currently there is no easy way to move strings between different tables. You need to copy&paste all values over. It would be really nice if there was some functionality to move strings to another table without a lot of effort.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,277
    Thanks for the suggestion. How would you want to move values between tables? How do you see it working in the editor?
     
  3. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    212
    I think that the most intuitive way for this to work is like, say, the file explorer: copy, cut, paste, delete, Ctrl+click multiple selection... all with their usual shortcuts, like Ctrl+X for cut and Delete for guess what. In fact, the Delete key isn't supported at the moment despite entry deletion being.
    For copy and cut, it would be nice for it to use the clipboard — like the inspector property copy — so that those with clipboard history enabled can copy multiple sets of items at once. Of course, you'd need to listen for Win+V pastes, not just Ctrl+V, unlike property paste.

    And some general feedback: I think that "New Table" and "Edit Table" should be in separate windows instead of tabs in the same window.
     
    karl_jones likes this.
  4. kork

    kork

    Joined:
    Jul 14, 2009
    Posts:
    280
    Copy & Paste are intuitive however it's a lot of clicking you have to do when you switch between tables. I rather had something in mind that resembles a refactoring in an IDE:

    Move.png

    You would have a select column where you can select entries (i would prefer this to a finicky CTRL-select where one misplaced click kills your selection). Then you have a button at the bottom for a refactoring action, like in this case move the selected strings to another table.

    For the move functionality you need to decide what to do with keys that already exist in the target table (overwrite, add a suffix to the moved keys, don't move keys already present in the target table, etc.). So if the move function detects a potential conflict it should open a dialog asking the user what to do:

    Dialog.png

    This could be easily extended for other mass-refactorings like cloning strings, deleting them, adding a prefix or suffix to their key, etc.
     
    karl_jones likes this.
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,277
    Thanks, thats a good suggestion. Ill put it down on our roadmap.