Skip to content

Commit

Permalink
PHRAS-3770: generate translation (#4414)
Browse files Browse the repository at this point in the history
* generate translation

* fix
  • Loading branch information
aynsix authored Nov 17, 2023
1 parent ca449d6 commit a29aa33
Show file tree
Hide file tree
Showing 12 changed files with 1,159 additions and 1,018 deletions.
8 changes: 6 additions & 2 deletions lib/Alchemy/Phrasea/Controller/Api/V1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1665,10 +1665,12 @@ private function listRecord(Request $request, record_adapter $record)
$technicalInformation[] = ['name' => $name, 'value' => $value];
}

$resourceId = $this->getResourceIdResolver()($record);

$data = [
'databox_id' => $record->getDataboxId(),
'record_id' => $record->getRecordId(),
'resource_id' => ($this->getResourceIdResolver())($record),
'resource_id' => $resourceId,
'mime_type' => $record->getMimeType(),
'title' => $record->get_title(['encode'=> record_adapter::ENCODE_NONE]),
'original_name' => $record->get_original_name(),
Expand Down Expand Up @@ -1722,11 +1724,13 @@ private function listStory(Request $request, record_adapter $story)
return $field->get_serialized_values();
};

$resourceId = $this->getResourceIdResolver()($story);

return [
'@entity@' => self::OBJECT_TYPE_STORY,
'databox_id' => $story->getDataboxId(),
'story_id' => $story->getRecordId(),
'resource_id' => ($this->getResourceIdResolver())($story),
'resource_id' => $resourceId,
'cover_record_id' => $story->getCoverRecordId(),
'updated_on' => $story->getUpdated()->format(DATE_ATOM),
'created_on' => $story->getCreated()->format(DATE_ATOM),
Expand Down
4 changes: 3 additions & 1 deletion lib/Alchemy/Phrasea/Controller/Api/V3/V3ResultHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ public function listRecord(Request $request, record_adapter $record, ACL $aclfor
$technicalInformation[] = ['name' => $name, 'value' => $value];
}

$resourceId = $this->getResourceIdResolver()($record);

$data = [
'databox_id' => $record->getDataboxId(),
'record_id' => $record->getRecordId(),
'resource_id' => ($this->getResourceIdResolver())($record),
'resource_id' => $resourceId,
'mime_type' => $record->getMimeType(),
'title' => $record->get_title(['encode'=> record_adapter::ENCODE_NONE]),
'original_name' => $record->get_original_name(),
Expand Down
5 changes: 4 additions & 1 deletion lib/Alchemy/Phrasea/Search/RecordTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ public function transform($recordView)
/** @var RecordView $recordView */
$record = $recordView->getRecord();

$resolver = $this->resourceIdResolver;
$resourceId = $resolver($record);

return [
'databox_id' => $record->getDataboxId(),
'record_id' => $record->getRecordId(),
'resource_id' => ($this->resourceIdResolver)($record),
'resource_id' => $resourceId,
'mime_type' => $record->getMimeType(),
'title' => $record->get_title(['encode'=> record_adapter::ENCODE_NONE]),
'original_name' => $record->get_original_name(),
Expand Down
4 changes: 3 additions & 1 deletion lib/Alchemy/Phrasea/Search/StoryTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ public function transform(StoryView $storyView)
{
$story = $storyView->getStory();

$resourceId = $this->recordTransformer->getResourceIdResolver()($story);

return [
'@entity@' => 'http://api.phraseanet.com/api/objects/story',
'databox_id' => $story->getDataboxId(),
'story_id' => $story->getRecordId(),
'resource_id' => ($this->recordTransformer->getResourceIdResolver())($story),
'resource_id' => $resourceId,
'cover_record_id' => $story->getCoverRecordId(),
'updated_on' => NullableDateTime::format($story->getUpdated()),
'created_on' => NullableDateTime::format($story->getUpdated()),
Expand Down
537 changes: 285 additions & 252 deletions resources/locales/messages.de.xlf

Large diffs are not rendered by default.

538 changes: 285 additions & 253 deletions resources/locales/messages.en.xlf

Large diffs are not rendered by default.

537 changes: 285 additions & 252 deletions resources/locales/messages.fr.xlf

Large diffs are not rendered by default.

536 changes: 284 additions & 252 deletions resources/locales/messages.nl.xlf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/locales/validators.de.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2023-10-04T11:58:26Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
<file date="2023-11-17T12:25:19Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
Expand Down
2 changes: 1 addition & 1 deletion resources/locales/validators.en.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2023-10-04T11:58:43Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
<file date="2023-11-17T12:25:35Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
Expand Down
2 changes: 1 addition & 1 deletion resources/locales/validators.fr.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2023-10-04T11:59:05Z" source-language="en" target-language="fr" datatype="plaintext" original="not.available">
<file date="2023-11-17T12:25:55Z" source-language="en" target-language="fr" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
Expand Down
2 changes: 1 addition & 1 deletion resources/locales/validators.nl.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2023-10-04T11:59:27Z" source-language="en" target-language="nl" datatype="plaintext" original="not.available">
<file date="2023-11-17T12:26:17Z" source-language="en" target-language="nl" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
Expand Down

0 comments on commit a29aa33

Please sign in to comment.