updated rep pdfs for multilingual
This commit is contained in:
@@ -14,6 +14,19 @@ import { getFormCollectionByID } from "../../components/utils";
|
||||
|
||||
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||
|
||||
import transLookupCY from "../../locales/cy/myrepresentations.json";
|
||||
import transLookupEN from "../../locales/en/myrepresentations.json";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
const getTrans = (locale, key) => {
|
||||
let jsonQuery = `$.${key}`;
|
||||
|
||||
let jsonObj = locale == "cy" ? transLookupCY : transLookupEN;
|
||||
|
||||
console.log(locale, jsonObj[key]);
|
||||
return jsonObj[key];
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
page: {
|
||||
backgroundColor: "white",
|
||||
@@ -117,7 +130,11 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
fontFamily: "Helvetica-Bold",
|
||||
}}
|
||||
>
|
||||
Final Comments
|
||||
F
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"final-comments-label"
|
||||
)}
|
||||
</Text>
|
||||
<View>
|
||||
<Text
|
||||
@@ -128,9 +145,9 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
fontFamily: "Helvetica-Bold",
|
||||
}}
|
||||
>
|
||||
For Planning, Conservation area, Listed
|
||||
{/* For Planning, Conservation area, Listed
|
||||
Building and Advertisement
|
||||
applications/appeals
|
||||
applications/appeals */}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -148,7 +165,12 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
fontFamily: "Helvetica-Bold",
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 14 }}>Case details</Text>
|
||||
<Text style={{ fontSize: 14 }}>
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-case-details-header"
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.sectionContainer}>
|
||||
<View
|
||||
@@ -158,9 +180,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>1a.</Text>
|
||||
<Text style={styles.questionBullet}>1.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
Case reference :
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"s78-section-question-1"
|
||||
)}{" "}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{values.caseRef}
|
||||
@@ -173,9 +199,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}></Text>
|
||||
<Text style={styles.questionBullet}>2.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
Representation capacity:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-representation-capacity-label"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{values.representationCapacity}
|
||||
@@ -188,9 +218,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}></Text>
|
||||
<Text style={styles.questionBullet}>3.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
Representation capacity{"\n"} details:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-representation-capacity-details-label"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
<Html style={styles.richArea}>
|
||||
@@ -214,9 +248,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>3.</Text>
|
||||
<Text style={styles.questionBullet}>4.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
Site address/grid ref:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"s78-section-question-3"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{values.siteAddress}
|
||||
@@ -229,9 +267,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>4.</Text>
|
||||
<Text style={styles.questionBullet}>5.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
Case Type:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-case-type-label"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{appealTypeValue.value}
|
||||
@@ -246,7 +288,12 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
fontFamily: "Helvetica-Bold",
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 14 }}>Comments</Text>
|
||||
<Text style={{ fontSize: 14 }}>
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-comments-header"
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.sectionContainer}>
|
||||
<View
|
||||
@@ -263,10 +310,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>
|
||||
5.
|
||||
6.
|
||||
</Text>
|
||||
<Text style={styles.questionTextMid}>
|
||||
Final Comments
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"final-comments-label"
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.questionAnswerWide}>
|
||||
@@ -285,7 +335,10 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 14 }}>
|
||||
Supporting documents
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-supporting-documents-header"
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.sectionContainer}>
|
||||
@@ -296,9 +349,12 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>11.</Text>
|
||||
<Text style={styles.questionBullet}>7.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
List of attached files
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-list-of-attached-files-label"
|
||||
)}
|
||||
</Text>
|
||||
<View
|
||||
style={[
|
||||
@@ -337,7 +393,13 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
fontFamily: "Helvetica-Bold",
|
||||
}}
|
||||
>
|
||||
<Text>Declaration</Text>
|
||||
<Text>
|
||||
{" "}
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-declaration-header"
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.sectionContainer}>
|
||||
<View
|
||||
@@ -357,7 +419,11 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
<Text
|
||||
style={{ width: "40%", fontSize: 12 }}
|
||||
>
|
||||
Signed:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-signed-label"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{values.firstname} {values.lastname}
|
||||
@@ -371,7 +437,11 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionText}>
|
||||
Date:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-date-label"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{signedDate}
|
||||
@@ -386,7 +456,11 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text style={{ width: "18%", fontSize: 12 }}>
|
||||
On behalf of:
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"statement-onbehalf-label"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswerWide}>
|
||||
{values.representationCapacity}
|
||||
|
||||
Reference in New Issue
Block a user