Diff for "Translations/Specs/UpstreamImportIntoUbuntu/FixingIsImported/setCurrentTranslation"

Not logged in - Log In / Register

Differences between revisions 12 and 15 (spanning 3 versions)
Revision 12 as of 2010-03-25 23:41:56
Size: 2271
Editor: jtv
Comment:
Revision 15 as of 2010-05-07 09:15:11
Size: 2589
Editor: jtv
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:

'''XXX jtv: Why not split off one side of this "if" into a C case?'''
Line 36: Line 38:
1. create TM 'new'<<BR>>new.is_current = True 1. Create & activate.
{{{
create TM 'new'
new.is_current = True
}}}
Line 38: Line 44:
2. create TM 'new'<<BR>>new.is_current = True<<BR>>new.potemplate = current.potemplate 2. Create, diverge, activate.
{{{
create TM 'new'
new.is_current = True
new.potemplate = current.potemplate
}}}
Line 40: Line 51:
4. new.is_current = True 4. Activate.
{{{
new.is_current = True
}}}
Line 42: Line 56:
5. if new.is_current: pass<<BR>>else: (2) 5. If other is not current, fork a diverged message.
{{{
if new.is_current: pass
else: (2)
}}}
Line 44: Line 62:
7. new.potemplate = None (watch for existing identical TM)<<BR>>new.is_current = True 7. Converge & activate.
{{{
new.potemplate = None # (watch for existing identical TM)
new.is_current = True
}}}
Line 48: Line 70:
   If found:    If found, steal its flag:
{{{
Line 51: Line 74:
}}}
'''XXX jtv: if not found, set new.is_other anyway?'''

Setting a translation

Assumptions

We're not setting a translation that's identical to the current one.

We've checked that lock_timestamp is newer than the last update date.

A diverged message cannot be both the current Ubuntu message and the current upstream message. Those would be diverged in different templates.

When we look for an "identical" message, we look for ones that are either shared or diverged in the same template that we're looking at. We completely ignore messages that are diverged to other templates.

What happens to the existing current message

XXX jtv: Why not split off one side of this "if" into a C case?

A: Deactivate & converge.

  If there is already an identical shared message:
    current.delete()
  else:
    current.is_current = False
    current.potemplate = None

B: Deactivate.

  current.is_current = False

What happens to the new current message

Some numbers are unused because their scenarios have collapsed into other ones.

1. Create & activate.

create TM 'new'
new.is_current = True

2. Create, diverge, activate.

create TM 'new'
new.is_current = True
new.potemplate = current.potemplate

4. Activate.

new.is_current = True

5. If other is not current, fork a diverged message.

if new.is_current: pass
else: (2)

7. Converge & activate.

new.potemplate = None # (watch for existing identical TM)
new.is_current = True

⊕. MERGING POLICY determines if we need to do:

  • Look for shared translation with the is_other flag set: 'other' If found, steal its flag:

       other.is_other = False
       new.is_other = True

XXX jtv: if not found, set new.is_other anyway?

By default, the policy should approve the change on is_other if working on upstream; or if working on Ubuntu but with privileges to edit both.

Execution matrix

IDENTICAL EXISTING TM 'new'

None

shared

diverged

upstream shared

CURRENT

None

Z1⊕

Z4⊕

Z7⊕

Z4⊕

shared

B1

B4

B7

B4

diverged

A2

A5

A4

A5

upstream shared

B1⊕

B4⊕

B7⊕

Ø

Notes

A diverged message can mask a similar shared message as well. We tried to take this into account throughout, and believe we covered it. Conditionals in the numbered parts ("what happens to the new current message") may warrant splitting rows or columns later.

Karma is being handled.

Translations/Specs/UpstreamImportIntoUbuntu/FixingIsImported/setCurrentTranslation (last edited 2010-06-19 03:51:36 by jtv)