开发者

What is a merge friendly format for entering text tokens

开发者 https://www.devze.com 2023-01-07 03:51 出处:网络
I have an excel list (excel 2003) where user enter translations for tokens. It has 3 columns (key, value, language). It can be something like key: Login.Header, value: \"Please login to the website\"

I have an excel list (excel 2003) where user enter translations for tokens. It has 3 columns (key, value, language). It can be something like key: Login.Header, value: "Please login to the website" language: en.

This works quite well. I use this file to generate language specific images in a website that uses lots of graphics for texts. The good thing is that users are able to enter text without installing new software, editing is nice and the resulting file can be read easily by my python script.

There is one think that I dislike: If 2 users edit the file and have lots of changes than merging gets a nightmare.

Is there an editing solution that is as good as excel in the areas I described but can be merged more easily?

EDIT

The answers so far explained how a source controll system can help in such a situation. But I already have SVN in place.

The question is about the file format. There are file formats that are easy to merge with a client like winmerge (like source code for java or c# backend classes) and there are others that are difficult to merge (xml, files generated by code generation).开发者_如何转开发 xls - files of excel 2003 can be diffed but it's still no nice format for merging.

I think there is a different application (something like apple works,open office, excel 2010 .. ) that let me edit a table but can be merged more easily.


Is there an editing solution that is as good as excel in the areas I described but can be merged more easily?

Maybe not exactly the expected answer but the best way to avoid merge and conflicts problems would be obviously to avoid having to merge. I would consider using a collaborative editing solution to avoid having to deal with various versions of the file:

  • If all your users are on a same network (LAN, VPN), then the first solution that come to mind would be to put a unique Excel file on a network share and to activate the Shared Workbook option. This works pretty well and, in case of conflict, users are prompted with a conflict resolution dialog box.

  • If this is not an option, then you could maybe put your spreadsheet on Google Docs. Google Docs works very well for collaborative work (it's easy to configure who can access a document, you can see a list of users currently connected, the collaborative edition just works). Then just export the spreadsheet for processing when done.

  • Use a collaborative text editor like Gobby (multi platform) and work on a raw CSV file. This won't be very user friendly though, especially for non techies, and error prone. I'd favor the above solutions.


One approach would be to export this Excel file as XML or CSV. Than use Excel to edit text-type file instead of default binary format of xls.

Also consider splitting the one big file into several files. This reduces the chances that two people want to work on the same file.

Put it under source control and introduce your users to basics of source control. Let uses will be responsible for merging files. SVN will be quite sensible for the task since it is a centralized and not a very complicated solution. Use a nice GUI for ordinary users.

With a centralized source control in place you may introduce locking. It allows you to deny write access once one user opens the file, so that only one user can edit a file at the same time.


Merging is often a pain. Some version control systems can do most of the legwork for you, merging non-conflicting changes and prompting the user when both attempt to change the same token.

Tortoise (SVN or Hg) have merge functionality that makes this painless. But I'm speaking as a developer - I've had quite a lot of difficulty introducing version control to non-developers, even the competent ones that don't use their CD tray as a cup holder. :)

You might consider splitting the one big file into several files. This reduces the chances that two people want to work on the same file. There is also the possibility of denying write access once one user opens the file, so that only one user can edit a file at the same time.


A little known/used feature of Excel is the "Shared Workbook" functionality. You can find it under Tools -> Share Workbook. Just click to the "Allow changes..." check box and you can fine tune in the "Advanced" tab.

This is bar-none the best option for having multiple users apply edits to a worksheet and works in two scenarios:

  1. Everyone downloads a copy of the XLS and edits on their side and uploads back to some location. You can then take this and merge it back with the original.
  2. Everyone opens the same copy of the XLS and makes edits at the same time. You can then merge any/all changes.


Let the users use an Excel file as now, but keep the data in a plain text file (csv, probably) under version control. Then you just need:

  • One small python script to convert the text file to Excel to give to the user.

  • One small python script to convert the completed Excel file back into text. This needs to sort the data consistently (on the key and the language, say) to simplify merges.


Any type of flat file would be pretty easy to merge.

If you wanted to stick with Excel, it wouldn't be hard to write a macro that would export the contents of the cells into the flat file. For usability, you could make the macro also save the sheet in native Excel format for future editing. If you placed a button on the sheet and linked it the macro, the user could export and save the file in one easy step by clicking the button.

0

精彩评论

暂无评论...
验证码 换一张
取 消