🔍 Translation Flow Test

1. Database Table Check

✅ Table exists
Records: 453

2. Helper Function Check

✅ get_translation() function exists
✅ translate_text() function exists

3. API Translation Test

Testing: 'Hello World'
Target Language: ur (Urdu)

HTTP Code: 403
Response:
{
  "error": {
    "code": 403,
    "message": "Cloud Translation API has not been used in project 737835539727 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=737835539727 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
    "errors": [
      {
        "message": "Cloud Translation API has not been used in project 737835539727 before or

❌ API Failed! Result: 'Hello World'
Check error logs: application/logs/

4. Database Save Test

Key: test_flow_1783491702
Text: Welcome to Test
Language: ur

Function returned: 'Welcome to Test'

❌ NOT saved in database!
Last Query: SELECT * FROM `translations` WHERE `key_name` = 'test_flow_1783491702'

Testing Manual Insert:
✅ Manual insert works! ID: 38012

5. Current Language Test

Session Language: Not Set
Cookie Language: Not Set
Current Language: en

6. Full Flow Test (Like View)

Simulating view with language: en

Welcome Text: 'Welcome to our CRM'

✅ 'welcome' key found in database:
Array
(
    [id] => 1
    [key_name] => welcome
    [en] => Welcome to our CRM
    [ur] => ????? CRM ??? ??? ?????
    [fa] => به CRM ما خوش آمدید
)

7. Language Switch Links

Click these links to test language switching:

English | Urdu | Persian (فارسی)

Go to Language Page