-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[2.1] Adding simple Zend/I18n/Loader/Tmx #1992
[2.1] Adding simple Zend/I18n/Loader/Tmx #1992
Conversation
Waiting to merge this until we have a separate branch for 2.1 development |
@weierophinney perhaps this may be a good moment to do so? |
New feature... I'd prefer to wait to 2.1, as we're in rc phase currently. On Saturday, July 28, 2012, Dolf Schimmel wrote:
Matthew Weier O'Phinney |
I added |
Hi, We have renamed the folder for tests from Zend to ZendTest. Can you rebase your PR to catch this change? Thanks in advance. |
|
||
foreach($result as $node) { | ||
$attributes = $node->attributes(); | ||
// Silently skip the nodes that does not have the 'tuid' attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't skip it silently, that can result in awkward error searching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At time when I wrote this I didn't see any sensible format validation in other loaders. Any suggestion how to handle it? Just an exception? I think additional data that is not translation is not a problem so we are OK to skip it. I probably should check tmx specification for that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @LukaszR here -- if the only bit that you're interested in are nodes with a specific attribute, skip them. Yes, it can potentially lead to hard-to-locate errors, but if you're mixing information in the file, you have to expect that.
@Maks3w I will try to find time for this, this evening. |
Closing as there was no activity for over a month. |
A simple version of loader plus tests. I choose SimpleXML because the solution implemented into version 1 seemed for me over-complicated and libxml is enabled by default. I'm not an xpatch expert so there may be a better way of implementing it.
I not sure if the loader should report any incompatibilities with the standard eg. missing tuid attribute or seg node so I skipped it for now.