You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: store_encode_locale.go
    path of file: ./repos/corteza/server/system/envoy
    
    the code of the file until where you have to start completion: package envoy

import (
	"context"
	"fmt"

	"github.com/cortezaproject/corteza/server/pkg/envoyx"
	"github.com/cortezaproject/corteza/server/pkg/id"
	"github.com/cortezaproject/corteza/server/store"
	"github.
    
func (e StoreEncoder) prepareResourceTranslation(ctx context.Context, p envoyx.EncodeParams, s store.Storer, nn envoyx.NodeSet) (err error) {
	// @todo existing resource translations?
	for _, n := range nn {
		if n.Resource == nil {
			panic("unexpected state: cannot call prepareResourceTranslation with nodes without a defined Resource")
		}

		res, ok := n.Resource.(*types.ResourceTranslation)
		if !ok {
			panic("unexpected resource type: node expecting type of ResourceTranslation")
		}

		// Run expressions on the nodes
		err = e.runEvals(ctx, false, n)
		if err != nil {
			return
		}

		res.ID = id.Next()

		// @todo merge conflicts if we do existing assertion

		n.Resource = res
	}

	return
}