Skip to content

Commit 2cb98a5

Browse files
Merge pull request #3 from codegasms/profile-page
Profile page
2 parents 8476ae9 + efc3a4a commit 2cb98a5

42 files changed

Lines changed: 4325 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,55 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<application
3-
android:label="farmerapp"
4-
android:name="${applicationName}"
5-
android:icon="@mipmap/ic_launcher">
6-
<activity
7-
android:name=".MainActivity"
8-
android:exported="true"
9-
android:launchMode="singleTop"
10-
android:theme="@style/LaunchTheme"
11-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
12-
android:hardwareAccelerated="true"
13-
android:windowSoftInputMode="adjustResize">
14-
<!-- Specifies an Android theme to apply to this Activity as soon as
2+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
3+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
4+
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" />
5+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
6+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
7+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
8+
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
9+
<uses-permission android:name="android.permission.INTERNET" />
10+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
11+
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
12+
<application android:label="farmerapp" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
13+
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
14+
<!-- Specifies an Android theme to apply to this Activity as soon as
1515
the Android process has started. This theme is visible to the user
1616
while the Flutter UI initializes. After that, this theme continues
1717
to determine the Window background behind the Flutter UI. -->
18-
<meta-data
19-
android:name="io.flutter.embedding.android.NormalTheme"
20-
android:resource="@style/NormalTheme"
21-
/>
22-
<intent-filter>
23-
<action android:name="android.intent.action.MAIN"/>
24-
<category android:name="android.intent.category.LAUNCHER"/>
25-
</intent-filter>
26-
</activity>
27-
<!-- Don't delete the meta-data below.
18+
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
<!-- Don't delete the meta-data below.
2825
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
29-
<meta-data
30-
android:name="flutterEmbedding"
31-
android:value="2" />
32-
</application>
33-
<!-- Required to query activities that can process text, see:
26+
<meta-data android:name="flutterEmbedding" android:value="2" />
27+
</application>
28+
<uses-permission android:name="android.permission.INTERNET" />
29+
<!-- Required to query activities that can process text, see:
3430
https://developer.android.com/training/package-visibility?hl=en and
3531
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
36-
3732
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
38-
<queries>
39-
<intent>
40-
<action android:name="android.intent.action.PROCESS_TEXT"/>
41-
<data android:mimeType="text/plain"/>
42-
</intent>
43-
</queries>
44-
</manifest>
33+
<queries>
34+
<!-- If your app opens https URLs -->
35+
<intent>
36+
<action android:name="android.intent.action.VIEW" />
37+
<data android:scheme="https" />
38+
</intent>
39+
<!-- If your app makes calls -->
40+
<intent>
41+
<action android:name="android.intent.action.DIAL" />
42+
<data android:scheme="tel" />
43+
</intent>
44+
<!-- If your sends SMS messages -->
45+
<intent>
46+
<action android:name="android.intent.action.SENDTO" />
47+
<data android:scheme="smsto" />
48+
</intent>
49+
<!-- If your app sends emails -->
50+
<intent>
51+
<action android:name="android.intent.action.SEND" />
52+
<data android:mimeType="*/*" />
53+
</intent>
54+
</queries>
55+
</manifest>

farmerapp/assets/avatar.png

5.37 KB
Loading

farmerapp/assets/lang/as.json

Lines changed: 80 additions & 2 deletions
Large diffs are not rendered by default.

farmerapp/assets/lang/bn.json

Lines changed: 80 additions & 2 deletions
Large diffs are not rendered by default.

farmerapp/assets/lang/en.json

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,82 @@
11
{
2-
"app_title": "My Flutter App",
3-
"welcome_message": "Welcome to my app!"
2+
"faq": "Frequently Asked Questions",
3+
"change_language": "Change Language",
4+
"current_langauge": "Your Current Language Is: ",
5+
"select_language": "Change Your Language: ",
6+
"contact_us": "Contact Us",
7+
"send_feedback": "Send Your Feedback",
8+
"locality": "Locality",
9+
"e_locality": "Enter Your Locality",
10+
"pincode": "Pincode",
11+
"e_pincode": "Enter Your Pincode",
12+
"e_feedback": "Enter Your Feedback Here",
13+
"submit": "Submit",
14+
"privacy_policy": "Privacy Policy",
15+
"last_updates": "Last Updated: 08-03-2024",
16+
"pp1": "1. Information We Collect",
17+
"pp1_t": "We collect information to provide better services to all of our users - from figuring out basic stuff like which language you speak, to more complex things like which ads you'll find most useful, the people who matter most to you online, or which YouTube videos you might like.",
18+
"pp2": "2. How We Use Information",
19+
"pp2_t": "We use the information we collect from all of our services to provide, maintain, protect and improve them, to develop new ones, and to protect our users. We also use this information to offer you tailored content – like giving you more relevant search results and ads.",
20+
"pp3": "3. Transparency and Choice",
21+
"pp3_t": "People have different privacy concerns. Our goal is to be clear about what information we collect, so that you can make meaningful choices about how it is used. For example, you can Review and control certain types of information tied to your Google Account using Google Dashboard.",
22+
"pp4": "4. Information You Share",
23+
"pp4_t": "Many of our services let you share information with others. Remember that when you share information publicly, it may be indexable by search engines, including Google. Our services provide you with different options on sharing and removing your content.",
24+
"pp5": "5. Accessing and Updating Your Personal Information",
25+
"pp5_t": "Whenever you use our services, we aim to provide you with access to your personal information. If that information is wrong, we strive to give you ways to update it quickly or to delete it – unless we have to keep that information for legitimate business or legal purposes.",
26+
"pp6": "6. Information We Share",
27+
"pp6_t": "We do not share personal information with companies, organizations and individuals outside of Google unless one of the following circumstances applies:",
28+
"pp7": "7. Information Security",
29+
"pp7_t": "We work hard to protect Google and our users from unauthorized access to or unauthorized alteration, disclosure or destruction of information we hold. In particular:",
30+
"pp8": "8. Compliance and Cooperation with Regulators",
31+
"pp8_t": "We regularly review this Privacy Policy and make sure that we process your information in ways that comply with it.",
32+
"pp9": "9. When this Policy Applies",
33+
"pp9_t": "Our Privacy Policy applies to all of the services offered by Google Inc. and its affiliates, including YouTube, services Google provides on Android devices, and services offered on other sites (such as our advertising services), but excludes services that have separate privacy policies that do not incorporate this Privacy Policy.",
34+
"pp10": "10. Our Commitment to Your Privacy",
35+
"pp10_t": "We protect your privacy and empower you to make informed choices about the information you share with us. This Privacy Policy is meant to help you understand what information we collect, why we collect it, and how you can update, manage, export, and delete your information.",
36+
"pp11": "11. Changes",
37+
"pp11_t": "Our Privacy Policy may change from time to time. We will not reduce your rights under this Privacy Policy without your explicit consent. We will post any privacy policy changes on this page and, if the changes are significant, we will provide a more prominent notice (including, for certain services, email notification of privacy policy changes). We will also keep prior versions of this Privacy Policy in an archive for your review.",
38+
"pp12": "12. Specific Product Practices",
39+
"pp12_t": "The following notices explain specific privacy practices with respect to certain Google products and services that you may use:",
40+
"pp13": "13. Other Useful Privacy and Security Related Materials",
41+
"pp13_t": "More useful privacy and security related materials are provided through Google’s policies and principles, like information on keeping your account secure, and guidance on privacy and security settings.",
42+
"pp14": "14. Contact Us",
43+
"pp14_t": "If you have any questions about this Privacy Policy, please feel free to contact us through our website or write to us at privacy matters.",
44+
"test": "Test",
45+
"terms_and_conditions": "Terms and Conditions",
46+
"tnc1": "1. Acceptance of Terms",
47+
"tnc1_t": "By accessing or using the Services, you agree to be bound by these Terms. If you do not agree to these Terms, please do not use the Services.",
48+
"tnc2": "2. Changes to Terms",
49+
"tnc2_t": "We may modify the Terms at any time, in our sole discretion. If we do so, we'll let you know either by posting the modified Terms on the Site or through other communications. It's important that you review the Terms whenever we modify them because if you continue to use the Services after we have posted modified Terms on the Site, you are indicating to us that you agree to be bound by the modified Terms. If you don't agree to be bound by the modified Terms, then you may not use the Services anymore. Because our Services are evolving over time we may change or discontinue all or any part of the Services, at any time and without notice, at our sole discretion.",
50+
"tnc3": "3. Privacy Policy",
51+
"tnc3_t": "Please refer to our Privacy Policy for information on how we collect, use and disclose information from our users. You acknowledge and agree that your use of the Services is subject to our Privacy Policy.",
52+
"tnc4": "4. User Conduct",
53+
"tnc4_t": "You are solely responsible for all code, video, images, information, data, text, software, music, sound, photographs, graphics, messages or other materials (\"content\") that you upload, post, publish or display (hereinafter, \"upload\") or email or otherwise use via the Service. The following are examples of the kind of content and/or use that is illegal or prohibited by us. We reserve the right to investigate and take appropriate legal action against anyone who, in our sole discretion, violates this provision, including without limitation, removing the offending content from the Service, suspending or terminating the account of such violators and reporting you to the law enforcement authorities. You agree to not use the Service to:",
54+
"tnc5": "5. Indemnity",
55+
"tnc5_t": "You agree to defend, indemnify and hold harmless us, our officers, directors, employees and agents, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, and expenses (including but not limited to attorney's fees) arising from: (i) your use of and access to the Service; (ii) your violation of any term of these Terms; (iii) your violation of any third party right, including without limitation any copyright, property, or privacy right; or (iv) any claim that your content caused damage to a third party. This defense and indemnification obligation will survive these Terms and your use of the Service.",
56+
"tnc6": "6. Warranty Disclaimer",
57+
"tnc6_t": "We have no special relationship with or fiduciary duty to you. You acknowledge that we have no duty to take any action regarding: which users gain access to the Services; what content you access via the Services; or how you may interpret or use the content. You release us from all liability for you having acquired or not acquired content through the Services. We make no representations concerning any content contained in or accessed through the Services, and we will not be responsible or liable for the accuracy, copyright compliance, or legality of material or content contained in or accessed through the Services.",
58+
"tnc7": "7. Limitation of Liability",
59+
"tnc7_t": "In no event shall we be liable to you or any third party for any indirect, consequential, exemplary, incidental, special or punitive damages, including lost profit damages arising from your use of the services, even if we have been advised of the possibility of such damages. Notwithstanding anything to the contrary contained herein, our liability to you for any cause whatsoever and regardless of the form of the action, will at all times be limited to the amount paid, if any, by you to us for the Service during the term of membership.",
60+
"tnc8": "8. General",
61+
"tnc8_t": "These Terms, the Privacy Policy, any operating rules, policies, or procedures that we may post from time to time on the Site, and any modifications to the foregoing, constitute the entire agreement between the parties with regard to the subject matter in these Terms and supersede all prior understandings and agreements, whether written or oral, as to such subject matter. Nothing contained in these Terms will be deemed to constitute either party as the agent or representative of the other party, or both parties as joint venturers or partners for any purpose. If any provision of these Terms is found to be invalid or unenforceable, that provision will be limited or eliminated to the minimum extent necessary so that these Terms will otherwise remain in full force and effect and enforceable. The failure of either party to exercise in any respect any right provided for herein will not be deemed a waiver of any further rights hereunder.",
62+
"tnc9": "9. Intellectual Property",
63+
"tnc9_t": "The Services and their original content (excluding content provided by users), features and functionality are and will remain the exclusive property of us and our licensors. The Services are protected by copyright, trademark, and other laws of both the United States and foreign countries. Our trademarks and trade dress may not be used in connection with any product or service without the prior written consent of us.",
64+
"tnc10": "10. Termination",
65+
"tnc10_t": "We may terminate or suspend your account and bar access to the Service immediately, without prior notice or liability, under our sole discretion, for any reason whatsoever and without limitation, including but not limited to a breach of the Terms. If you wish to terminate your account, you may simply discontinue using the Service. All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.",
66+
"tnc11": "11. Governing Law",
67+
"tnc11_t": "These Terms shall be governed and construed in accordance with the laws of California, United States, without regard to its conflict of law provisions. Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding our Service, and supersede and replace any prior agreements we might have between us regarding the Service.",
68+
"tnc12": "12. Contact Us",
69+
"tnc12_t": "If you have any questions about these Terms, please contact us.",
70+
"common_practices": "Common Practices",
71+
"change_account": "Accounts",
72+
"name": "Name: ",
73+
"gender": "Gender: ",
74+
"dob": "Date Of Birth: ",
75+
"alternate_contact": "Alternate Contact",
76+
"state": "State: ",
77+
"district": "District: ",
78+
"user_profile": "User Profile",
79+
"general": "General",
80+
"other_settings": "Other Settings",
81+
"logout": "Log Out"
482
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from googletrans import Translator
2+
import json
3+
4+
def translate_json(json_file_path, languages):
5+
with open(json_file_path, 'r', encoding='utf-8') as file:
6+
data = json.load(file)
7+
8+
translator = Translator()
9+
10+
for language in languages:
11+
# Load existing translations for the language
12+
output_file_path = f'{language}.json'
13+
try:
14+
with open(output_file_path, 'r', encoding='utf-8') as output_file:
15+
translated_data = json.load(output_file)
16+
translated_keys = set(translated_data.keys())
17+
except FileNotFoundError:
18+
# If the file does not exist, start fresh
19+
translated_data = {}
20+
translated_keys = set()
21+
22+
new_translations = {}
23+
for key, value in data.items():
24+
# Translate only if the key is not already translated
25+
if key not in translated_keys:
26+
translated_value = translator.translate(value, dest=language).text
27+
new_translations[key] = translated_value
28+
translated_keys.add(key)
29+
30+
# Update the existing translations with new ones
31+
translated_data.update(new_translations)
32+
33+
# Write the updated translations to language.json
34+
with open(output_file_path, 'w', encoding='utf-8') as output_file:
35+
json.dump(translated_data, output_file, ensure_ascii=False, indent=2)
36+
37+
return f'Translations updated for {languages}'
38+
39+
# Example usage:
40+
json_file_path = 'en.json'
41+
languages = ['bn', 'gu', 'hi', 'kn', 'ml', 'mr', 'or', 'pa', 'ta', 'te', 'ur']
42+
result = translate_json(json_file_path, languages)
43+
print(result)

0 commit comments

Comments
 (0)