It seems like you're asking several questions, here. First, when you ask where to put the query, that's really up to the design you're following. A repository pattern seems like a reasonable idea for data access in a lot of cases, but I've no idea if it's appropriate or not in your case. Are you already using repositories elsewhere, for example?
Second, are you looking for a working, "generic" query (ie. one that will work for any number of languages) in SQL, or through LINQ?
If in LINQ, please take a look at the answers to this question. They might be applicable: http://stackoverflow.com/questions/963491/pivot-data-using-linq
If in SQL, and assuming you're using SQL Server, you can indeed perform a pivot either with GROUP BY or, if you're running a recent version, the PIVOT operator. However, neither case supports a dynamic number of languages - the requested columns for each must be declared explicitly. Like so:
--GROUP BY
SELECT ct.CatID,
MAX(CASE WHEN l.LangName = 'English' THEN ct.CatName END) AS English,
MAX(CASE WHEN l.LangName = 'French' THEN ct.CatName END) AS French
FROM CategoryText ct INNER JOIN Languages l ON l.LangID = ct.LangID
GROUP BY ct.CatID;
--PIVOT
SELECT ct.CatID, English, French
FROM CategoryText ct INNER JOIN Languages l ON l.LangID = ct.LangID
PIVOT(MAX(ct.CatName) FOR l.LangName
IN([English], [French])) AS P;
Since the Pivot operator doesn't support a dynamic statement like a subquery in the spreading argument (IN(English, French)), I'm not sure how to handle the generic case. Hopefully this will at least clarify your direction.