To solve the given optimization problem, we first need to define the decision variables and the objective function. Let's denote:

- \(x\) as the number of international employees,
- \(y\) as the number of local employees.

The objective is to minimize the total weekly wage bill. Given that international employees earn $500 per week and local employees earn $1200 per week, the objective function can be formulated as:

\[ \text{Minimize} \quad 500x + 1200y \]

The constraints are as follows:

1. The total number of employees should be at least 50:
\[ x + y \geq 50 \]

2. At least 12 employees should be local:
\[ y \geq 12 \]

3. The number of local employees should be at least a third of the number of international employees:
\[ y \geq \frac{1}{3}x \]

4. The total weekly wage bill should not exceed $40,000:
\[ 500x + 1200y \leq 40000 \]

Now, let's translate these constraints and the objective function into Gurobi code in Python:

```python
from gurobipy import *

# Create a model
m = Model("Wage_Bill_Optimization")

# Define decision variables
x = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="International_Employees")
y = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="Local_Employees")

# Objective function: Minimize the total wage bill
m.setObjective(500*x + 1200*y, GRB.MINIMIZE)

# Constraints
m.addConstr(x + y >= 50, "Total_Employees")
m.addConstr(y >= 12, "Minimum_Local_Employees")
m.addConstr(y >= (1/3)*x, "Local_to_International_Ratio")
m.addConstr(500*x + 1200*y <= 40000, "Wage_Bill_Limit")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"International Employees: {x.x}")
    print(f"Local Employees: {y.x}")
    print(f"Total Wage Bill: ${500*x.x + 1200*y.x:.2f}")
else:
    print("No optimal solution found")
```