为同一项目的翻译版本组织 SVN 的最明智方法是什么?
我很抱歉,因为我知道这已经被一遍又一遍地报道过,但我正在尝试了解巧妙地使用颠覆来为我们带来利益的最明智的方法。 (*注:我知道我们的方法不是处理本地化版本的最佳方法,但外部因素迫使我们在当前项目中以这种方式工作)
- 我们有一个相当静态的英文网站...html、css、js 等.
- 网站从翻译器返回后,我们将拥有相同代码的 5 种变体(本周……将来可能还会有 25 种!)。因此,我们很快就会有一个 EN、FR、SP、DE 等文件夹。大多数文件(css、js、img)将保持完全相同;和 html 文件(结构、id、类)只会根据元素内的本地化文本而变化。
如果需要进行小的更改,是否有任何方法可以使用巧妙的 SVN 文件夹结构来帮助我们,而不必手动更改网站每个翻译版本中的文件?
谢谢! --bp
I apologize because I know this has been covered over and over again, but I'm trying to understand the smartest way to cleverly use subversion to our benefit. (*Note: I know our method is not the BEST way to handle localized versions, but external factors are forcing us to work this way on current projects)
- We have a fairly static website in English...html, css, js, etc.
- After the site comes back from the translator we will have 5 variations of the same code (this week...then potentially 25 more in the future!). So we'll soon have a folder for EN, FR, SP, DE, etc. Most files (css, js, img) will remain exactly the same; and html files (structure, id's, classes) will only vary based on the localized text inside the elements.
Is there any way to use clever SVN folder structuring that would help us out in the event that if a small change is needed, we don't have to manually change the files in each and every translated version of the site?
Thanks!
--bp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用 svn:externals 属性来达到此目的。 这里是一个简短的说明教程。
简而言之,该属性将帮助您在存储库的不同部分重用相同的目录。您可以隔离目录中的常见文件并在本地化目录中引用该目录。
You should use svn:externals property for the purpose. Here is a brief tutorial.
In short, the property will help you reuse the same directories in different part of the repository. You can isolate common files in a directory and reference the directory in your localization directories.
嗯,通常您希望避免出现“中性”文件的重复项,并且您永远不应该翻译其中包含实际逻辑的文件(当然,除非逻辑本身因语言而异)。
不过,您可以轻松地将不变的 CSS 和 JS 文件放在源代码树和服务器上的单独顶级目录中,因此这不应该成为太大的问题。
没有什么聪明的 SVN 技巧可以用来避免更改所有 HTML 文件,但是您可能不需要更新翻译吗?
Hmm, generally you want to keep from having duplicates of "neutral" files, and you should never be translating files with actual logic in them (unless, of course, the logic itself varies between languages).
You could easily put the invariant CSS and JS files in a seperate top-level directory both in your source tree and on the server, though, so that shouldn't be too much of an issue.
There's no clever SVN trick you can use to avoid having to change all of the HTML files, but won't you probably need to update the translations for that anyways?