-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pootle formats base delegation, models and classes #4966
Conversation
|
||
POOTLE_FORMATS = [ | ||
("po", | ||
dict(title='Gettext PO file', |
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.
Does this not need lazy localisation?
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.
maybe it does - but i had added a unique_together with extension (to prevent menu duplication) so i should probs remove it in that case - maybe not
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.
If we are displaying this title to the users then it must be localizable. If you want to keep a unique_together
, something that makes sense because of all the formats that share the .properties extension, then I suggest adding an internal name that can be used for the unique check, like:
POOTLE_FORMATS = [
("po",
dict(title=_('Gettext PO'),
name='Gettext PO'
extension="po",
template_extension="pot")),
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.
@unho its unnecssary duplication - if you see in the code it has a name po
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.
also re localizing the title - as this is stored in the db my understanding is that this is not the place to localize (im happy to be wrong tho)
1b036dd
to
6977dbb
Compare
# AUTHORS file for copyright and authorship information. | ||
|
||
|
||
POOTLE_FORMATS = [ |
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.
@phlax why did you put too few formats? Should we link them with ttk formats?
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.
any formats we add we will need proper support for. Im thinking initially it should just be po and xliff actually.
df7d8d8
to
b418e55
Compare
7603a02
to
868c567
Compare
extension="xliff", | ||
template_extension="xliff")), | ||
("xlf", | ||
dict(title='XLIFF Translation File', |
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.
How are you going to differentiate both XLIFF entries if they have the same title?
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.
In filetypes code we used different strings: https://github.com/translate/pootle/blob/master/pootle/apps/pootle_store/filetypes.py#L23-L24
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.
Because the title is always displayed with the extension - and there is a unique_together on them for that reason.
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.
Displayed together in the UI like "Gettext PO file (.po)"?
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.
yep
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 am not seeing anything like that in 59d58aa#diff-99489b5e96e0f37f2daaa11c328f4d0dR31
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 can add it further up the stack - probs on __str__
is a good idea actually - but for ref - here is where its actually used - https://github.com/translate/pootle/pull/4963/files#diff-83014e45acc5cd6424075fd6a8861be1R37
2529668
to
4e87dda
Compare
4e87dda
to
24d99e5
Compare
lgtm |
Adds a pootle_formats app to register, retrieve and override format handling in Pootle
This is useful for implement multi-format projects #4929 and is also useful for implementing monolingual formats #4957